Create your off-chain receive address
- 1. Connect your wallet in the asset manager
- 2. Select "My assets" and create a new asset
- 3. Click your new asset to see your x402 facilitator address
Create an x402 payment signature
- 1. Open your wallet in the asset manager
- 2. Deposit funds into your payment channel
- 3. Create an x402 payment claim and take a copy
$ pip install dhali-py
======================
from dhali.dhali_channel_manager import DhaliChannelManager, ChannelNotFound
from dhali.config_utils import get_available_dhali_currencies, wrap_as_x402_payment_payload
from eth_account import Account
from web3 import Web3
private_key = "0x..."
account = Account.from_key(private_key)
w3 = Web3(Web3.HTTPProvider("https://ethereum-sepolia.publicnode.com"))
currencies = get_available_dhali_currencies()
sepolia_rlusd = next((c for c in currencies if c.network == "SEPOLIA" and c.code == "RLUSD"), None) # or "USDC"
manager = DhaliChannelManager.evm(
account=account,
w3=w3,
currency=sepolia_rlusd
)
off_chain_payment = manager.get_auth_token()
x402_payment = wrap_as_x402_payment_payload(off_chain_payment, b64_payment_required_header)
$ npm install dhali-js
======================
const { createWalletClient, createPublicClient, http } = require('viem')
const { privateKeyToAccount } = require('viem/accounts')
const { sepolia } = require('viem/chains')
const { DhaliChannelManager, getAvailableDhaliCurrencies, wrapAsX402PaymentPayload } = require('dhali-js')
const account = privateKeyToAccount('0x...')
const publicClient = createPublicClient({ chain: sepolia, transport: http("https://rpc.ankr.com/eth_sepolia") })
const walletClient = createWalletClient({ account, chain: sepolia, transport: http() })
const configs = await getAvailableDhaliCurrencies()
const sepoliaUsdc = configs.find(c => c.network === "SEPOLIA" && c.code === "USDC")
const manager = DhaliChannelManager.evm(
walletClient,
publicClient,
sepoliaUsdc
)
token = await manager.getAuthToken(1000000); // 1 USDC
x402Payment = wrapAsX402PaymentPayload(token, paymentRequiredHeader)
Send off-chain payments to yourself
Settle on-chain when you’re ready
- 1. Enter the asset manager
- 2. Select "My assets" and select your asset
- 3. View your earnings. Your payments will settle nightly
Our integrations
Bithomp: Accessing APIs using payment channels.
Our users
Here's what they said.
Dhali made is great to work with and made it really easy to set up nanopayments for our APIs.
Dhali is a great marketplace for developers and projects that are wanting to monetize their APIs.
Navigation was simple and straight to the point; didn't have to be a rocket scientist to understand it.
Pricing
Usage-based, chain-agnostic pricing.
What is the latency of the API request?
Dhali's x402 facilitator will incur a 30-110 ms latency, depending on whether the off-chain payment has already been verified. With Dhali as a proxy, the latency depends on your API.
What will you charge for your API?














