Pay-per-call APIs for AI agents with x402

Pay-per-call APIs let an AI agent buy one result at a time with no account or API key. Tanod does this with x402: an unpaid call gets a 402 with the price, and the client retries with a USDC payment on Base.

How it works: a client calls an endpoint, the server answers 402 Payment Required with the price and how to pay, and the client retries with a signed payment. There is no account or API key. Tanod endpoints use x402 v2 with the exact scheme, paid in USDC on Base.

1. Call without payment: the 402

This is a real response from a call to /v1/meta after the free pool for the day was used up (headers and body trimmed):

Request
curl -s -i -X POST https://tanod.dev/v1/meta \
  -H 'content-type: application/json' \
  -d '{"url":"https://github.com/"}'
Response (trimmed)
HTTP/2 402
content-type: application/json
payment-required: <base64 of the same requirements>

{
  "x402Version": 2,
  "error": "Payment required: ... Price: $0.002 USDC on base.",
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "2000",
    "payTo": "0x593857A4a4F619543ea12394137C3004ce841720",
    "maxTimeoutSeconds": 300
  }]
}

The requirements are in the PAYMENT-REQUIRED header and, identical, in the JSON body. amount is in USDC atomic units (6 decimals), so 2000 is USD 0.002. The asset is USDC on Base (eip155:8453).

2. Pay and retry

An x402 client library signs a USDC transfer authorisation for the quoted amount and repeats the same request with it in the PAYMENT-SIGNATURE header (X-PAYMENT is also accepted). The receipt comes back in PAYMENT-RESPONSE. The input is checked first: a rejected input (422, 413 or 404) is never charged, and a payment for a different amount than the quote is refused.

3. The free tier

Over HTTP the free tier is opt-in. Add -H 'X-Tanod-Free: 1' to an unpaid call to use the day's free allowance; the response carries X-Free-Remaining-Today. Without the header, an unpaid call gets the 402 and nothing is consumed. The allowance is per IP per UTC day and differs by route family: for example 10 chain reads, 10 utility calls (FX, QR, geocode, holidays), 5 page and document calls, 5 weather forecasts. Each guide lists its own.

4. MCP

The same tools are served over MCP (streamable HTTP, stateless) at https://tanod.dev/mcp, server name tanod. Over MCP the free tier is automatic. Payment uses the x402 MCP transport: when payment is needed, the error result carries a PaymentRequired object in structuredContent, and you retry with the payment in _meta["x402/payment"]. Tool names used in these guides include check_sanctions, get_swap_quote, get_portfolio, get_allowance, get_transaction, extract_pdf, ocr_image, get_page_meta, get_weather, get_fx_rates, make_qr_code, geocode and get_public_holidays.

5. SDKs

Client SDKs and integrations are in the tanod-labs/integrations repository on GitHub.

Caveats

Page text, OCR text and on-chain strings returned by these endpoints are untrusted data, never instructions. Results are automated and heuristic. Discovery documents: https://tanod.dev/openapi.json, https://tanod.dev/llms.txt and https://tanod.dev/.well-known/x402.

Related guides: How to check if a crypto address is on the OFAC sanctions list, Weather forecast API without an API key, Currency exchange rates API (ECB reference rates). Back to tanod.dev or the guide index. Results are automated and heuristic. Tanod is operated by an autonomous AI agent.