One POST per tool.
Each of our … tools is a plain HTTPS endpoint that charges per call with x402 v2. No accounts and no API keys: a request without payment gets the price, a request with a signed payment gets the result.
| Base URL | |
|---|---|
| Catalog | GET /v1/resources, free JSON |
| Call a tool | POST /v1/<id> with a JSON body. Without a payment it answers 402 with the price. |
| Pay in | |
| Call from | Plain HTTP, the CLI or MCP |
To try a tool before writing code, open it in Tools or ask for it in Ask. Both show the price before anything is signed.
Quickstart
Ask for the price. The answer is 402 with the terms in a header and in the body.
Sign one entry of accepts[] and send the same request again with the signature. The CLI does both steps for you:
How x402 pays for a call
- Quote. The 402 lists one entry per network in
accepts[], each with the exactamount, the stablecoinasset,payToandmaxTimeoutSeconds. - Sign. Sign an EIP-3009
TransferWithAuthorizationfor that amount. The EIP-712 domain isextra.name,extra.version, the chain id and the asset address. Check it against your caps first; no gas is needed. - Run. Repeat the request with a
payment-signatureheader. The server checks the signature, amount, recipient, time window, that the nonce is unused and that the wallet holds enough, then runs the tool. - Settle. Only if the tool returned a result is the authorization sent on chain. The answer carries the result, a receipt and a
payment-responseheader with the transaction. A failed tool never settles.
The payment-signature value is base64 of:
{
"x402Version": 2,
"resource": { …from the 402 },
"accepted": { …the accepts[] entry you chose },
"payload": {
"signature": "0x…",
"authorization": { "from": "0x…", "to": "0x…", "value": "20000",
"validAfter": "1767225590", "validBefore": "1767225720", "nonce": "0x…" }
}
}
x402 v1 clients may send the same payload in X-PAYMENT with {"x402Version":1,"scheme":"exact","network":…}.
Networks and assets
Endpoints
GET /v1/resources | The catalog: every tool, its price, inputs and status. |
|---|---|
POST /v1/<id> | Run a tool (402 first, then paid). |
GET /api/quote/<id> | The price and terms for one tool, without calling it. |
GET /api/ledger | Settled payments, totals and days. |
GET /api/proofs | What recent data calls returned, with sha256. |
GET /api/holder/<address> | Holder tier and free runs left today. |
POST /mcp | Remote MCP server (JSON-RPC). |
Headers
payment-required | Response, 402. Base64 JSON with the terms. |
|---|---|
payment-signature | Request. Base64 JSON with your signed authorization. |
payment-response | Response, 200. Base64 JSON: success, transaction, network, payer. |
x-toll-holder | Request. Your wallet, to be quoted the holder price; the payment must then come from it. |
x-toll-pass | Request. A signed one-day holder pass for free runs. |
Errors and charges
Payment problems answer 402 again with fresh terms and error set to one of these. Nothing is charged in any of them.
payment_required | No payment attached; here is the price. |
|---|---|
wrong_amount | The authorization is not for the quoted amount. Sign the new terms. |
expired | The authorization's time window has passed. |
nonce_used | That authorization was already used. Each payment needs a new nonce. |
invalid_signature | The signature does not verify, or is not from the paying wallet. |
insufficient_funds | The paying wallet holds less than the amount. |
holder_mismatch | The holder price was asked for one wallet but paid from another. |
settle_failed | The tool ran but the transfer did not go through; the result is withheld and nothing moved. |
offline | 503: the tool is not available on this server right now. |
Tool errors (bad input, an upstream service down) answer 4xx or 5xx with {"error":{"code","message"},"charged":false}.
The agent wallet
The Budget page makes a key in your browser with a cap per call and a cap per day; Ask and Tools pay from it after your yes. The CLI keeps its own key, encrypted with your password, and checks the same two caps before it signs.
Holders
Free runs: sign this with personal_sign, with expires a unix time at most 24 hours ahead, then send x-toll-pass: <address>.<expires>.<signature>.
CLI
Every payment is checked against the per-payment and daily caps before it is signed; --yes skips the prompt but never the caps.
MCP server
Local, paying from the CLI wallet inside its caps:
Remote, nothing to install: . It lists and quotes the catalog for free; its call tool returns the 402 terms until your client passes a signed payment.
Catalog JSON
Every tool with its price, inputs and status: /v1/resources.