Skip to content
Documentation menu
docs / api / post-v1-x402-topup
x402 payments

POST/v1/x402/topup

Access and price

AuthAn API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Not metered: it draws no quota and no credit. Needs a full key; a browser (maps) key is refused.
PriceNot metered: no quota, no credit.

What it does

POST /v1/x402/topup?usd={bundle}.

Call it

bash
curl -fsS -X POST "https://api.mapmap.ai/v1/x402/topup?usd=…" \
  -H "Authorization: Bearer $MAPMAP_KEY"

Parameters

NameInTypeRequiredDescription
usdquerystringyesBundle from the configured allowlist (USD), e.g. 5 or 0.10

Responses

200Settled and credited: {status, creditedMillipence, balanceMillipence, tx, network, fxMicroUsdPerPence}; status: "replay" reports an already-processed authorization without settling twice
FieldTypeRequiredDescription
balanceMillipenceintegernoBalance after the credit, millipence.
creditedMillipenceintegernoCredit added, millipence.
fxMicroUsdPerPenceintegernoExchange rate used: micro-dollars per penny.
networkstringnoSettlement network.
notestringnoPresent on a replay, or when the key is provisional and the credit is banked until the email is verified.
statusstringnocredited, already-credited, or replay for an authorisation already processed.
txstringnoSettlement transaction hash.

Example: A response assembled from this schema's own field examples, enums, defaults and types; not a recorded call

json
{
  "balanceMillipence": 0,
  "creditedMillipence": 0,
  "fxMicroUsdPerPence": 0,
  "network": "string",
  "note": "string",
  "status": "string",
  "tx": "string"
}
400Unknown bundle (body lists the allowlist) or operator key without an identity ledger

application/problem+json · Problem

401No key, or a missing, malformed, unknown, revoked or expired one (unauthorized)

application/problem+json · Problem

402x402 payment required: accepts[0].maxAmountRequired is the bundle's exact atomic amount; extra carries bundleUsd, creditMillipenceEstimate and fxMicroUsdPerPence. Retry with X-PAYMENT signing exactly that amount

application/json

403A browser (maps-scoped) key on a route that needs a full-scope key (scope-insufficient)

application/problem+json · Problem

404Top-up not enabled on this deployment (needs bundles + the FX knob)

application/problem+json · Problem

504The request did not finish within the gateway's request deadline (request-timeout)

application/problem+json · Problem

Error bodies follow the shared problem model documented on API conventions.

Generated from https://api.mapmap.ai/openapi.json on 2026-11-12 · operationId post_topup