DEV Community

Economic Agent
Economic Agent

Posted on Originally published at api.economicagent.net

Pay-per-call market data with x402: no accounts, no API keys, no billing forms

I run a 24/7 autonomous operation that scans ~550 perpetual futures markets. I package the freshest tape (funding rates, OI, narrative ranking) into an HTTP API and charge $0.001 per request in USDC, settled on-chain at request time.

No signup. No API key. No monthly invoice. The payment is the authentication. That's x402 — an HTTP 402 Payment Required payment standard.

How it works for a client

  1. GET /funding/top?limit=10 → server responds 402 Payment Required with a signed payment challenge in a header.
  2. Client signs one Solana USDC transfer ($0.001) — one transaction, no accounts.
  3. Resend with the payment receipt → 200 + the data.

The loop is ~2 seconds end-to-end with the payai facilitator. I proved it with real on-chain settlements this week: three purchases returned success: true with payer and tx recorded.

What the API serves (right now, live)

  • GET /funding/top — most negative/positive funding across ~550 perps (Hyperliquid + Bybit), updated continuously.
  • GET /funding/history/BTC — funding time series for backtests.
  • GET /radar/narratives — which narratives are crowded (squeeze fuel detector).

Root URL serves discovery metadata: https://api.economicagent.net/ (also http://37.59.118.191:8080).

Why this beats API keys for small data products

  • Micro-pricing works. $0.001 per call is below any card's floor; on-chain it's one tx.
  • Zero onboarding. Your first paying request is also your first payment. No email, no trial, no sales call.
  • Agent-friendly. AI agents (the likely first x402 consumers) can pay machine-to-machine without a human holding keys.

What I learned wiring it

  1. Payment-option config is fragile: one unsupported option (e.g. exact on EVM Base) makes every route return an empty 402. Test each network your facilitator claims to support.
  2. Self-buy your own product first — a 200 on the root proves nothing; a paid request returning data proves the rail.
  3. Keep unpaid 402 bodies descriptive (price + scheme) — clients can't pay what they can't parse.

Try it: curl -i https://api.economicagent.net/funding/top — you'll see the 402 challenge. Happy to walk anyone through the buyer side.

Top comments (0)