HostDeFi › Features › x402 RPC
x402 RPC: pay-per-call JSON-RPC for agents
One machine-paid call = one POST of a JSON-RPC payload to rpc.hostdefi.com's x402 lane — $0.002 per call in USDC, 82 chains, no account and no API key. Agents that can't hold a key pay per request; the monthly rk1_* key is the volume shelf.
The x402 lane is the per-call shelf on HostDeFi's 82-chain relay — the same JSON-RPC engine that serves the free endpoints, gated by an HTTP-402 payment challenge instead of a key. An agent (or any HTTP client with a USDC wallet) POSTs a standard {jsonrpc,id,method,params} object — or a batch of up to 10 — receives the 402 offer, settles the $0.002 payment, and gets the upstream result verbatim.
- No account, no key, no KYC. The payment header is the credential — a client that can pay USDC on a supported network can call.
- Charge-on-success. An upstream error — unknown chain, disallowed method, batch cap, rate limit — is mirrored back uncharged. A 200 carrying a JSON-RPC error object is an answered call and settles, the same way every RPC provider bills method-level refusals.
- 82 chains, one pattern. ethereum, base, solana and the full published list — swap the chain slug, keep the call shape. Per-chain pages under /rpc/ carry the same curl.
- Discoverable. The lane is advertised in agent.json and registered with the x402 bazaar via the PayAI facilitator, so discovery tools find and price it without a human in the loop.
The two paid lanes, honestly priced
| Lane | Price | Shape |
|---|---|---|
| x402 per-call | $0.002 / call (USDC) | Batches of ≤10 items · agents and bursty workloads |
rk1_* monthly key | $25 / 30 days (USDC) | 3,000 items/min, batches to 100 · bots and services |
The free public lane still exists underneath both — baseline reads with no key at all, rate-limited per IP. The RPC hub lists every chain's free endpoint.
Try the 402 offer yourself
POST a call without a payment header and the endpoint answers with the machine-readable offer — a browser can't show it, curl can:
curl -s -X POST https://rpc.hostdefi.com/api/v1/x402/rpc/ethereum \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
What is x402 RPC on HostDeFi?
A machine-payable JSON-RPC lane: POST a standard JSON-RPC call (or a batch of up to 10) to https://rpc.hostdefi.com/api/v1/x402/rpc/{chain}, receive an HTTP 402 offer, pay $0.002 in USDC, and get the upstream result verbatim.
Which chains does the x402 RPC lane cover?
All 82 chains on the relay — ethereum, base, solana and the full published list at hostdefi.com/api/rpc/chains.
When do I pay for an x402 call?
Charge-on-success: an upstream error (unknown chain, disallowed method, rate limit) is mirrored back uncharged. A 200 carrying a JSON-RPC error object is an answered call and settles — the same way every RPC provider bills method-level refusals.
Is there a cheaper lane for volume?
Yes — the $25/30-day rk1_ key carries batches to 100 items and 3,000 items/min. x402 is the per-call shelf for agents that can't hold a key.
How do agents discover the x402 endpoints?
They're advertised in hostdefi.com/.well-known/agent.json and registered in the x402 bazaar via the PayAI facilitator, so discovery tools can find and price them without a human in the loop.