Sample exchange
Keep this receipt. It lives on-chain anyway.
Farebox is a pay-per-request API on Robinhood Chain. Your agent asks, Farebox answers 402 with a price, the agent signs once, and Farebox settles the USDG on-chain and pays the gas. No keys, no accounts, nothing held in custody.
Sample exchange
Keep this receipt. It lives on-chain anyway.
— requests served through the router (— in the last 24 h), last one —. On-chain: — settlements, — USDG moved on Robinhood Chain.
Refreshes every 15 s · median latency — · full log on the status page.
POST /api/v1/chatThe agent asks like any HTTP client would.402 Payment RequiredFarebox names the price. Nothing has moved yet.HTTP/1.1 402 Payment Required PAYMENT-REQUIRED: base64 of ↓ { "x402Version": 2, "accepts": [{ "scheme": "exact", "network": "eip155:4663", "amount": "1000", // 0.001 USDG "asset": "0x5fc5…d168", // USDG on Robinhood Chain "payTo": "0xYourMerchantAddress", "maxTimeoutSeconds": 120, "extra": { "assetTransferMethod": "permit2" } }] }
The 402 is the invoice. It names the exact amount, asset, recipient and how long the offer stands. Any x402 client reads it and pays without a human.
POST /api/v1/chat PAYMENT-SIGNATURE: …The agent retries with a signed authorization attached.PAYMENT-SIGNATURE: base64 of ↓ { "permit2Authorization": { "from": "0xAgent", "permitted": { "token": "0x5fc5…d168", "amount": "1000" }, "spender": "0x4020…0001", // x402 Permit2 proxy "nonce": "…", "deadline": "", "witness": { "to": "0xYourMerchantAddress", "validAfter": "0", "extra": "0x" } }, "signature": "0x…" // EIP-712, PermitWitnessTransferFrom }
A Permit2 signature, not a transaction. It's bound to one token, one amount, one recipient and a short deadline. After a one-time approval the agent pays no gas and holds only USDG.
POST /verify{ "isValid": true, "payer": "0xAgent" }POST /settle{ "success": true, "transaction": "0x…" }One transfer, agent to Farebox. Nothing is held in escrow. A replayed signature is refused: the Permit2 nonce is spent on-chain.
200 OK PAYMENT-RESPONSE: …The response the agent asked for, with a receipt in the header.HTTP/1.1 200 OK PAYMENT-RESPONSE: base64 of { "success": true, "transaction": "0x…", "network": "eip155:4663" } { "model": "farebox-router", "choices": [{ "message": { "role": "assistant", "content": "…" } }] }
The whole exchange is two round-trips. The agent's HTTP client did it without a human, an account, or an API key.
No plans, no cards, no accounts. Each request is one small USDG payment, and every IP gets a daily allowance to try it with nothing at all.
fbx_sk_… key once on the demo page; your agent spends it at 0.005 USDG per request with Authorization: Bearer. No wallet in the agent, top up any time.Farebox-Free: 1 and the router answers without an invoice until the allowance is spent.An OpenAI-compatible chat endpoint, priced per completion. Drop-in for any client that speaks x402.
Standard x402 packages. The client handles 402 → sign → retry inside fetch. USDG on Robinhood Chain isn't an SDK default yet, so the asset is spelled out; it pays through Permit2, so the wallet approves Permit2 once.
import { privateKeyToAccount } from 'viem/accounts'; import { x402Client, wrapFetchWithPayment } from '@x402/fetch'; import { ExactEvmScheme } from '@x402/evm/exact/client'; const account = privateKeyToAccount(process.env.AGENT_KEY); const USDG = '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168'; const NETWORK = 'eip155:4663'; const client = x402Client.fromConfig({ schemes: [{ network: NETWORK, client: new ExactEvmScheme(account) }], spendControls: { allowedAssets: [{ network: NETWORK, asset: USDG, maxAmountPerPayment: '100000', }] }, }); const pay = wrapFetchWithPayment(fetch, client); const res = await pay('…/api/v1/chat', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ messages: [{ role: 'user', content: 'hi' }] }), }); // 402 → sign → retry → 200, handled inside pay()
import OpenAI from 'openai'; const client = new OpenAI({ baseURL: '…/api/v1', apiKey: 'fbx_sk_…', // funded once on /demo }); const r = await client.chat.completions.create({ model: 'farebox-router', messages: [{ role: 'user', content: 'hi' }], }); console.log(r.choices[0].message.content);
curl …/api/v1/chat \ -H 'Farebox-Free: 1' \ -H 'content-type: application/json' \ -d '{"messages":[{"role":"user","content":"hi"}]}' # 200 OK # Farebox-Free-Remaining: 4 # { # "model": "farebox-router", # "choices": [{ "message": { "role": "assistant", "content": "…" } }] # } # # once the allowance is spent, the same call is 402 # and any x402 client pays 0.005 USDG per request
Farebox runs its own. These four endpoints are what the payment SDKs talk to; you never call them yourself.
/verifyCheck a signed payment. No gas, nothing changes on-chain.
/settleVerify again, simulate, then broadcast the Permit2 transfer.
/supportedPayment kinds, networks and the relayer that signs settlements.
/healthRPC reachability and latest block for each Robinhood Chain network.
Farebox settles USDG, the Global Dollar, on Robinhood Chain. Gas is ETH and the relayer pays it, so a payer only holds USDG.
/verify. It never becomes a reverted transaction.Farebox is getting its own token on Robinhood Chain, the same network every request settles on. It is not needed to use the API today: requests are paid in USDG, and the free allowance costs nothing. First use, coming soon: hold a set amount and your requests are free. The threshold, contract address and buy link are announced here and on X first.
Until an address is shown on this page, no address claiming to be the token is ours. Treat anything else as a scam.
Start with the free allowance, then pay per request or fund a key. Everything settles on Robinhood Chain.
…/api/v1/chat