The Zerion API supports three ways to authenticate a request:
| Method | Best for | How it works |
|---|
| API key | Apps and services with steady traffic | HTTP Basic Auth with a key from the Dashboard. Subject to rate limits. |
| x402 | AI agents and per-call workloads | Pay USDC on Base or Solana per request. No API key, no rate limits. |
| MPP | AI agents and per-call workloads | Pay USDC on Tempo per request. No API key, no rate limits. |
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:
Authorization: Basic BASE64_ENCODED_KEY
Go to the Dashboard Get Started section for ready-to-use code snippets with your API key pre-filled.
# Transform your API key for Basic Auth
API_KEY_TRANSFORMED=$(echo -n "YOUR_API_KEY:" | base64)
# Make the request
curl -X GET "https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/portfolio" \
-H "Authorization: Basic $API_KEY_TRANSFORMED" \
-H "accept: application/json"
Security best practices
Never expose your API key in client-side code or public repositories.
- 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
The two protocols differ only in which chain they settle on:
Both cover the same set of endpoints as API-key auth and accept the same parameters. Pick whichever chain your wallet already holds USDC on. The Zerion CLI supports both via --x402 / --mpp flags.