Skip to main content
By the end of this page your agent will have paid a service that has never heard of Nevermined, from a budget you control, with the spend on your ledger. Everything here is plain HTTP. The Nevermined SDKs don’t expose the Router yet, so the examples use curl and fetch — which is also the point: any agent, in any language, can drive it.
Prefer to have your coding assistant do this? These five steps ship as an AI coding skill. In Claude Code, /plugin marketplace add nevermined-io/docs then /plugin install nevermined-router@nevermined; elsewhere, see AI Coding Skill. It also carries the guardrails an autonomous buyer must respect, which matter more than the calls themselves.
Driving this from an agent harness? Using the Catalog from a harness is the code-free companion to this page — the same flow, plus the safety habits (idempotency across retries, soft stops below your cap, funding for merchant + fee) an autonomous buyer should follow.
Set your environment once. The Catalog is Live-only for payment: every listed service settles on mainnet. The sandbox Router funds testnets only, so it pays only two free testnet test merchants kept for rehearsal (mpp-dev-paid-ping and x402-org-protected, see the Commerce MCP page), and no other Catalog listing is payable there. Point at the live host:

1. Get an API key

Create one from the Nevermined app. Every Router call carries it as Authorization: Bearer $NVM_API_KEY.
Older keys don’t work with the Router. If you have a key from an earlier generation, the Router rejects it with 403 BCK.ROUTER.0008 — it’s bound to a previous account model that can’t sign these payments. The fix is simply to create a new key; newly issued keys work. Existing keys keep working for credit-based flows, so there’s no rush to rotate anything else.
Never send this key to the service you’re paying. It authenticates you to Nevermined, nothing else.

2. Create a Delegation

A Delegation is your budget: a hard cap in cents and an expiry. Create it once and reuse the id for every payment until it’s exhausted or expires.
That’s a $5.00 cap for 7 days. The cap is enforced server-side on every single payment — your agent cannot spend past it by looping, retrying, or misreading its own budget.
provider: "erc4337" is the crypto-funded Delegation, which is what both stablecoin rails use. A card-funded Delegation is a different provider and is not accepted on those rails.

3. Fund your wallet

Both rails pull: the merchant takes the money from your own wallet. A Delegation authorizes the spend, but the wallet has to actually hold the funds. Find its address on the Delegation:
fundingWalletAddress is the wallet address to fund, and only ?withPayer=true returns it. For a personal Delegation it is your own wallet, not providerPaymentMethodId (the smart-account address), which the Router never spends from; for an org-wallet Delegation the two are the same. null on a crypto Delegation means the wallet could not be resolved: read it again, and if it stays null, stop and report it to the human. Never fund providerPaymentMethodId instead. Send the wallet the payment asset on the network you intend to pay on: The address is the same on every EVM chain — it’s one key-derived wallet, so there is nothing extra to create on Tempo. But the balances are per-chain: funding Base does nothing for an MPP tempo payment. See the x402 rail and the MPP rail for the full picture.
You fund this wallet; your agent cannot refill it, and a Nevermined credit balance cannot top it up. Open the Wallet on your Nevermined App profile, pick the chain under Network, and use + Add on the token’s row:
  • Receive funds: a plain transfer, on any network the Wallet lists — those of the environment the App is switched to, live or sandbox.
  • Buy with card: USDC only, on live Base (USDC) and live Tempo (USDC.e), through Privy’s on-ramp — never on a testnet (Base Sepolia, Tempo Moderato). It isn’t offered today for EURC / EURC.e. Card coverage is region-restricted: MoonPay doesn’t cover Tempo USDC.e in the EU/EEA or Canada. Where the card checkout doesn’t serve you, Receive funds still works.
On the Tempo networks, + Add is enabled only once your account wallet has had its EIP-7702 upgrade; on an older account it stays disabled there.When the wallet runs dry, payments stop until you add more: on MPP with a clean 402 BCK.ROUTER.0009, on x402 less kindly, because that rail doesn’t check the balance before signing. Budget for that when you decide how much to fund — and fund for the merchant’s price plus any routing fee. An agent is autonomous after it is funded, and only until the balance runs out. This is the on-chain wallet the delegation spends; Nevermined credits are a separate balance an agent can refill within a human-set limit — see Top-ups.
Always read this address back from the live Delegation rather than reusing one you saved. A stale address is the single most common cause of a confusing 402 BCK.ROUTER.0009. On MPP-tempo the error does name the wallet and the chain it checked — so compare it against the one you funded — but it never echoes the balance, and on x402 there is no pre-check and no 0009 at all. wallet_balance in the Catalog MCP reads the amount back.

4. Make a paid call

POST /api/v1/router/run is the call to use. Name a catalog service by its slug, say what to send, and read one answer however it was paid (a delegation or Nevermined credits). It needs no protocol detection on your side: the Router probes the service, pays the 402 and relays the result. Start with a dry run. It prices the call and lists anything that would refuse it, and charges nothing. The service does receive the request unpaid so it can name its price, and a service that does not ask for payment runs it, so do not dry-run a call with side effects there. Checks the quote could not make are listed in unchecked and do not block. The example calls SpecStream’s page extractor (specstream, POST v1/extract, $0.002 a call on Base); for another service, use its slug and its endpoint’s invokePath ?? path from the catalog.
The answer has wouldSucceed, any blockers (the first is the error the real call would return), the price and, when a delegation would pay, a quoteId. Send the quoteId on the real call to pay that sealed quote (410 BCK.ROUTER.0032 once it has expired, after 60 seconds; 409 BCK.ROUTER.0033 if the call changed; quote again in either case). Without it the price is indicative, and the service’s price at call time governs. Then make the real call: the same body without dryRun, plus an Idempotency-Key header.
A 200 answer has the same envelope, whichever way it was funded:
  • funding says what paid (delegation or credits). fundingReason is the credits refusal code that moved a default call to the delegation, and null otherwise (and on a replay). With no funding field the Router pays with credits when the account can; a delegationId is then only the fallback payer, used when credits are not available to the account or refuse the call for a reason the delegation can solve. Any other credits refusal is the answer. Send "funding": "delegation" to always pay from the delegation. With nothing to pay with, the answer is 402 BCK.ROUTER.0055.
  • price is what the call cost, in the funding’s own unit: currency and micros (millionths of it, the service’s price plus the routing fee) for a delegation, { "credits": N } for credits. On a usage-based (x402 upto) call it is the maximum reserved, not the cost: once the settlement is reconciled, GET /api/v1/router/payments?requestId= shows what the service took (settledAmount).
  • deliveryStatus is the paid call’s outcome, as on the payments ledger: delivered, not_delivered (the service answered the paid call with an error), charged_not_delivered, charged_unconfirmed, not_charged or pending; null when nothing was paid.
  • status, contentType and data are the service’s answer. data is its body as dataEncoding says: json, text, or base64 for a binary answer. A paid call the service refused is still a 200 here, with success: false and the service’s status.
A 202 means paid and still running. A call that outlives the synchronous wait answers 202 with requestId, funding, fundingReason, paymentId, resultUrl, status: "Pending" and replayed (on credits, also payment.creditsLeft and payment.topUp, the credit pack the call bought, if any), and no envelope. Send the same request again with the same key until the result is ready, to get the envelope; resultUrl answers in /route’s shape instead. Never buy it again under a new key. A refusal keeps the API’s standard error body (code, hint, httpStatus, retryable and the rest, with the same status) and adds success: false, requestId (the key, or null when the call was refused before it was read), funding (the payer that refused it, or null) and nextTool: the call that leads on, as { "mcp", "method", "path", "body"? }, or null. For example BCK.ROUTER.0054 names GET /api/v1/router/payments?requestId=<your key> (the Catalog MCP’s list_payments), and BCK.SUBSCRIPTION_ROUTER.0020 names /run again with body: { "dryRun": true } merged into your call.

Idempotency

A real call needs a key: the Idempotency-Key header or the body’s requestId, which are the same thing. If you send both they must be equal, and the key never goes inside the forwarded headers. Without one the call is 400 BCK.ROUTER.0001. Use one stable key per logical purchase, not per HTTP attempt.
  • A retry never pays twice. The same key with the same request returns the first call’s stored result (replayed: true, header Idempotency-Replayed: true) for 24 hours (replay and the 202 need API 1.48 or later: a request that resolves below it, such as a key pinned below 1.48 with no Nevermined-Version header, gets the 409 below; send Nevermined-Version: 1.48 or later on the retry). While the first call is still running, a retry gets 409 BCK.ROUTER.0002 (or the same 202, past the synchronous wait): keep the key and try again later. After 24 hours it is that 409 with nothing to replay, and so it is when the first paid call failed without an answer (502 BCK.ROUTER.0034 or 0025): retrying will not change it, so reconcile by requestId, never with a new key.
  • The same key with a different request is 422 BCK.ROUTER.0054. The method, path, query, body or service differs from the first call. Headers, delegationId and funding are not compared: a retry that changes the payer replays the first payment and does not pay from the new one. Do not answer 0054 with a new key if you are retrying a call whose outcome you do not know: a new key is a new purchase. Reconcile first with GET /api/v1/router/payments?requestId=<the original key> and only then decide.
  • Paid calls only. If the service answers without asking for payment, nothing is recorded under the key and a retry runs the call again. A dry run ignores the key, so the same key can go on the real call.
/run takes a slug, never a URL, and returns the merchant’s answer whole. To stream an answer or proxy a call transparently, use /svc/<slug> (or /proxy), or /subscription/svc/<slug> to stream on credits. A call that asks for a stream (an Accept: text/event-stream in headers) is refused 400 BCK.ROUTER.0059 before anything is sent. /run dispatches to /route, /commerce/route and /subscription/route; those are the lower-level routes it is built on, and still work if you need their exact request or response shape.

The lower-level /route

POST /api/v1/router/route pays a delegation directly, by url or slug, and answers with the merchant’s status and body plus paid and payment:
The response carries the merchant’s status and body unchanged, plus what the call cost you:
If the resource turned out to be free, you get paid: false and no payment block — the Router relays it and charges nothing.
Use one stable requestId per logical purchase, not per HTTP attempt. It’s the idempotency key: retrying a dropped call with the same id returns the original payment instead of buying twice. Retrying with a fresh id buys twice, on purpose.That applies to the snippet above, which uses a fixed id: run it a second time and you get 409 BCK.ROUTER.0002, carrying the original paymentId, rather than the response shown. That is the guarantee working, not a failure — change the id to buy again.

5. Check what you spent

Every payment across every protocol is on one ledger — see the ledger page for filters, CSV export, and the aggregate summary.

When something is refused

Refusals are the system working. The ones you’re most likely to meet: Guardrails covers every code and, more usefully, why widening a cap in response to a refusal is almost always the wrong move.

Next

The x402 rail

Networks, assets, and what “exact” means.

The MPP rail

Tempo charges, receipts, and the asset allowlist.