What has to be true before an agent sees a 402
An unauthenticated route request for a standard profile on api.mapmap.ai returns 200, not 402. The paywall is further in than most people assume: it fires for an authenticated snk_ key that has run past its allowance, and only then. On 27 July 2026 an agent met that condition on a truck route, paid 0.015 USDC on Base without a human present, and got its answer. The settlement is in block 49178110, 15,000 atomic units of USDC from the payer wallet to our treasury, timestamped 09:46:07 UTC.
Why does a keyless call come back 200?
Because a narrow demo lane exists, and a routing GET is on it. When the gateway is configured with a positive SN_DEMO_RPM, an unauthenticated request to one of five paths is admitted under a synthetic identity called demo, behind a per-IP token bucket and a daily cap. The five paths are GET /route/v1/*, GET /geocode, GET /geocode/reverse, GET /geocode/suggest and GET /geocode/retrieve. Standard profiles only: a truck profile, a dimension, hazmat or a tunnel code on GET /route/v1 always needs a key, and the 401 says so. Demo traffic is never metered, never billed and never quota-weighted, and when the bucket empties you get a 429 with Retry-After, not a 402.
Everything outside that list keeps its 401. Today, a keyless POST /elevation answers:
{
"type": "urn:sn-gateway:problem:unauthorized",
"status": 401,
"title": "Unauthorised",
"detail": "unauthorised: missing API key: send `Authorization: Bearer snk_…` or `?api_key=snk_…`",
"docs": "https://mapmap.ai/docs",
"hint": "self-issue a free key in one call: POST /v1/keys with {\"email\": \"you@example.com\", \"accept_tos\": true, \"source\": \"agent-recipe\"}, then send it as `Authorization: Bearer snk_…`",
"signup": "https://mapmap.ai/signup?utm_source=api-401&utm_medium=api"
}
The 401 is not a dead end: it hands back the call that fixes it, which is the point of a keyless agent being able to get itself a key.
This matters because it is a correction to a story we could have told more neatly. Our own payment rehearsal script labelled step zero "keyless call, expect 401", and the captured artefact is a 200 with a full route in it. The script's expectation was wrong about production. SN_DEMO_RPM defaults to 0, so a self-hosted deployment is 401 everywhere until an operator opens the lane deliberately.
What condition actually produces the 402?
An identity that is out of allowance, on a gateway that has x402 configured. The gateway walks a fixed ladder on every metered request once the free tier is spent, and the branch it lands on decides between 402 and 429:
| Identity state | Answer |
|---|---|
| Operator-issued key (neither provisional nor verified) | 429, never a 402 |
| Provisional key past its 1,000-call allowance | 402 |
| Verified key past the free tier, never bought credit, x402 configured | 402 |
| Verified key past the free tier, never bought credit, x402 not configured | 429 |
| Has prepaid credit, but the balance is below this request's price | 402 |
| Has prepaid credit covering the price | 200, debited from the ledger |
The recorded run hit the second row. A provisional key is what POST /v1/keys gives you in one call with no card, it is good for 1,000 calls over 72 hours, and past that the 402 body carries this in its error field:
provisional key call allowance exhausted (1000 calls); verify your email to
unlock the free tier of 50000 calls/month
That is the honest version of the demo. The agent was not turned away at the door for having no key. It had a key, it had spent the key's allowance, and it chose to pay rather than stop.
What did the payment look like on the wire?
A 402 carrying a priced quote, then the same request again with an X-PAYMENT header. The 402 arrived in 255 ms and quoted the exact request rather than a flat tariff:
{
"x402Version": 1,
"accepts": [{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "15000",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"payTo": "0x3b1959E548d7c63fC1f588a824423Df1503a4d9A",
"maxTimeoutSeconds": 60,
"extra": {
"name": "USD Coin", "version": "2",
"class": "premium", "units": 1, "listPence": 1.0,
"fxMicroUsdPerPence": 15000, "minChargeApplied": false
}
}],
"error": "…"
}
Read the extra object and the arithmetic is checkable: one billable unit, premium class because it is a truck route, list price 1p, converted at 15,000 microdollars per penny, so $0.015, so 15000 atomic units of a six-decimal token. A second entry in the same accepts[] offers the identical charge in USDC on Solana. The client was the stock x402-fetch package with nothing bespoke in it: it signed an EIP-3009 transferWithAuthorization off-chain, base64-encoded it into X-PAYMENT, and retried. The paid 200 came back in 1,687 ms with a 326,543 m route for a 44-tonne, 4 m vehicle from Dover to Birmingham.
Is the receipt what it looks like?
Nearly, and the gap is worth stating. The USDC moved exactly as described: block 49178110, status ok, 0.015 USDC from 0xaf75e1956dB2e9dC890A6bd9E1568da9B2B24EEd to 0x3b1959E548d7c63fC1f588a824423Df1503a4d9A, and the payer's balance fell from 1.700299 to 1.685299 USDC in the same run.
Two honest details. First, the transaction's from address is not the agent. The agent signed an authorisation; the PayAI facilitator broadcast it, batched through Multicall3, and paid the gas. That is the design of the exact EVM scheme and it is why an agent needs USDC but no ETH. Second, our harness did not receive the X-PAYMENT-RESPONSE header inside its settlement wait window, so its own summary file records "tx": null. The hash above was recovered afterwards by matching USDC Transfer logs from the payer to the treasury. The payment is real and the chain proves it; the receipt header simply did not arrive in time, which is exactly the asynchronous-settlement caveat we published when x402 went live on mainnet.
What this still does not give you
- No settlement-status endpoint. If settlement lands after the response window, you get no
X-PAYMENT-RESPONSE. A 2xx already means the payment verified and the call is final; reconcile on-chain if you need the hash. - The per-call floor is real. The minimum charge is $0.005, so a 0.05p standard call bought per-call is a poor deal by design. The 402 sets
minChargeApplied: truewhen it bites. - Per-call always prices at the entry band. Volume discounts live on the prepaid rail, so for standard-class volume, credit is strictly cheaper than paying each request. The pricing page has both schedules.
- The demo lane is an operator choice, not a promise. It covers five GET paths on the hosted gateway, under a per-IP rate limit and a daily cap, it is unmetered, and it can be closed. Do not build against it.
Try it
Issue a provisional key with one POST /v1/keys, spend its 1,000 calls, and let a stock x402 client answer the 402 that follows. The x402 documentation is authoritative on the wire shapes, the extra quote object and the 402-versus-429 rules, and the earlier x402 status post covers what was switched off before mainnet and why. Every 402 we serve names the receiving wallet, so the settlement trail is public by construction and every number in this post can be checked against the chain rather than taken from us.
Routing derives from OpenStreetMap. Credit "© OpenStreetMap contributors" when you render or republish it.
