Skip to main content
Every AnyAPI endpoint accepts inline crypto payment. An agent with a funded wallet can call any of the 200+ APIs without signing up, creating a key, or holding a balance: it makes the request, gets a 402 Payment Required with machine-readable payment instructions, pays, and retries. The wallet is the identity, and you pay per call in USD. Two payment rails are supported on the same endpoints:

x402

Settle in USDC on Base mainnet. Gasless: the facilitator sponsors gas, you sign an authorization. Works with any standard x402 client.

MPP

Machine Payments Protocol, settling on Tempo. The buyer signs and broadcasts the transfer, then replays the credential.
Which path do you want? This page is the no-account path: pay each call from a crypto wallet, nothing to set up. If you would rather hold a USD balance and call with an API key, see the Quickstart or let your agent onboard itself. Both hit the same /v1/run/{sku} endpoints.

How inline payment works

The flow is the standard HTTP 402 handshake, identical for both rails: AnyAPI validates the SKU and input before it calculates a challenge or accepts a payment. An unknown SKU or invalid payload therefore fails immediately without asking the agent to pay.
1

Call the endpoint

Make a normal POST https://api.getanyapi.com/v1/run/{sku} with the SKU’s JSON input and no credentials.
2

Get a 402 with payment instructions

AnyAPI responds 402 Payment Required. The x402 challenge rides in the PAYMENT-REQUIRED header (and the response body); the MPP challenge rides in the WWW-Authenticate: Payment header. Each carries the price, the network, the asset, and the address to pay.
3

Pay and retry

Your client signs the payment and re-sends the request with the credential attached (PAYMENT-SIGNATURE / X-PAYMENT for x402, Authorization: Payment for MPP). AnyAPI verifies the payment, runs the API, and returns 200 with the result plus a receipt header.
A client library does all of this for you. You only write the original request.

Pay with x402 (Base, USDC)

The simplest path is a standard x402 client such as x402-fetch, which wraps fetch and handles the 402, the signature, and the retry automatically. Point it at any SKU:
You only pay on success. With x402, AnyAPI settles the payment after the API call succeeds, so a failed run never charges you. The response includes costUsd (the USD charged) and provider: "AnyAPI". A recognized empty result such as found: false is a successful answer and is charged like any other successful result.
What the challenge advertises, if you implement the wire format yourself:
  • Network: Base mainnet (eip155:8453).
  • Asset: USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913).
  • Price: the per-call USD amount, in the challenge’s amount (atomic units).
  • Versions: the v2 challenge is in the PAYMENT-REQUIRED header; the v1 challenge is in the response body, so stock x402-fetch works out of the box. Pay back with PAYMENT-SIGNATURE (v2) or X-PAYMENT (v1).

Pay with MPP (Tempo)

The same endpoints accept Machine Payments Protocol on Tempo. Use the mppx client, which signs and broadcasts the transfer, then replays the credential:
The MPP challenge arrives as a WWW-Authenticate: Payment header (method="tempo", intent="charge"); you settle on Tempo (chain id 4217) and replay the credential in Authorization: Payment. AnyAPI returns the result with a Payment-Receipt header.
MPP settles the transfer before AnyAPI executes the request. If execution then fails after the payment is verified, the request returns an error but the on-chain transfer cannot be automatically reversed. Keep the response’s request ID and transaction reference when contacting support about one of these uncommon cases.

What you pay

  • Per call, in USD. Each endpoint is priced in real dollars, shown as the amount in the 402 challenge and as costUsd in the result. There is no subscription and no minimum.
  • No balance to hold. You pay straight from your wallet on each call; nothing is pre-funded with AnyAPI.
  • AnyAPI is the provider. Responses report provider: "AnyAPI" and the USD cost, the same normalized shape as a keyed call.
  • Empty can still be successful. A normalized result such as found: false means the lookup completed and found no matching entity. It is a successful, billable result rather than an upstream failure.
Prices are low (many SKUs are a fraction of a cent), so set a sane per-call cap in your client (maxValue for x402) and let the agent transact freely under it.

Discovery

AnyAPI’s endpoints are listed in the x402 Bazaar (the Coinbase facilitator’s discovery index) and on explorers like x402scan, so an agent can find a SKU, read its input and output schema, and pay it without you wiring anything up. You can also pull the full machine-readable spec at https://api.getanyapi.com/openapi.json.