The rest of this page covers the API key flow. For pay-per-request flows, see the dedicated x402 and MPP pages.
API key
The Zerion API uses HTTP Basic Authentication. You can get your API key from the Dashboard.Try it from the docs
Every API reference page has an interactive playground. Click Try it, paste your API key in the Username field, leave Password empty, and hit Send to make a live request.Using the API from your code
When calling the API from code, append a colon to your API key (your_api_key:), Base64-encode it, and pass it in the Authorization header:
Security best practices
- Store your API key in environment variables
- Make API requests from server-side code
- Rotate your key immediately if it’s ever compromised
- Use separate keys for development and production
Pay-per-request: x402 and MPP
Both x402 and MPP let you call the Zerion API by paying a small USDC fee per request instead of presenting an API key. They’re a better fit than API keys when:- You’re building an AI agent or automated pipeline that shouldn’t manage long-lived credentials
- Traffic is bursty or unpredictable and you don’t want to size a rate-limited plan
- You want usage-based cost accounting at the request level
- x402 (Coinbase’s open protocol) — settles in USDC on Base or Solana. Uses the
PAYMENT-SIGNATURErequest header. - MPP (Machine Payments Protocol) — settles in USDC on Tempo. Uses the
Authorization: Paymentrequest header.
--x402 / --mpp flags.