Agent payments (x402 & MPP)
Pay-per-call API access for AI agents via x402 and Machine Payments Protocol
Overview
Human subscribers use API keys and the public proxy or direct API. AI agents can access the same economic data without a dashboard account by calling machine-to-machine (M2M) routes on the website origin, paying per request with either x402 or MPP.
Official protocol documentation:
Request flow
- Send
GETorPOSTto/api/v1/m2m/...on the site host (see Base URL). - If payment is required, the server responds with
402 Payment Requiredand includes both payment challenges in one response (x402 + MPP). - Complete payment using one of the rails, then retry the same request with the matching credential header.
Base URL for agents
Agents should use the dashboard / marketing site host so payment headers are forwarded end-to-end:
https://econdash.org/api/v1/m2mAppend the same paths as the public API (see Endpoints), e.g. /stats, /timeseries/{code}, /news, metadata routes.
Do not rely on /api/proxy?path=/api/v1/m2m/... for the full pay-and-retry flow: the generic proxy does not forward payment credential headers on subsequent requests. Use /api/v1/m2m/... directly on the site.
x402 (Base mainnet)
| Field | Value |
|---|---|
| Network | Base mainnet (eip155:8453) |
| Asset | USDC |
| Token contract | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| Explorer | Basescan — USDC on Base |
Challenge: Decode the PAYMENT-REQUIRED header (base64 JSON). Use the payTo, amount, asset, and network fields from that payload — do not hardcode them in clients.
Typical server configuration charges 0.02 USDC per call (20000 minimal units, 6 decimals). Exact values always come from the challenge.
Credential on retry: PAYMENT-SIGNATURE header.
Signing: Follow x402 client documentation. For USDC on Base, the EIP-712 domain name and version must match the on-chain token (e.g. "USD Coin" and "2"), not the ticker shorthand.
MPP (Tempo mainnet)
| Field | Value |
|---|---|
| Network | Tempo mainnet |
| Asset | pathUSD |
| Token contract | 0x20C0000000000000000000000000000000000000 |
| Explorer | Tempo Explorer — pathUSD |
Challenge: Parse WWW-Authenticate: Payment per MPP HTTP 402.
Typical charge is about 0.02 USD per call; exact terms come from the challenge / server configuration.
Credential on retry: Authorization: Payment <token>.
Receipt: Successful responses may include a Payment-Receipt header.
Use an MPP client SDK (e.g. TypeScript mppx, Python pympp) to build and verify credentials.
Minimal curl outline
# First request — expect 402; read PAYMENT-REQUIRED and WWW-Authenticate
curl -i "https://econdash.org/api/v1/m2m/stats"After you obtain a valid x402 or MPP proof with your wallet or SDK, retry the same URL with PAYMENT-SIGNATURE or Authorization: Payment ... as required by the protocol.
Rate limiting
Responses with 402 may be rate-limited per IP on the backend (e.g. M2M_402_PER_IP_PER_MINUTE). Use backoff and avoid hammering unpaid endpoints.
Related
- Endpoints — full route list (M2M mirrors these paths under
/api/v1/m2m). - Quick Start — trial and API-key access for humans.