API Reference/Overview
Authentication
Every endpoint needs an API key. Three header forms, and what failure looks like.
On this page
Headers
Use any one of three forms — each matches a protocol's SDK default:
text
Authorization: Bearer YOUR_APIONE_KEY OpenAI protocol, and the general form
x-api-key: YOUR_APIONE_KEY Anthropic protocol
x-goog-api-key: YOUR_APIONE_KEY Gemini protocolSend one key per request. Putting different keys in several headers returns 401 straight away.
Validating a key
bash
curl -s -o /dev/null -w "%{http_code}\n" \
https://api.apione.ai/v1/models \
-H "Authorization: Bearer $APIONE_API_KEY"200 means the key is valid and enabled.
Failure responses
| Status | message | Typical cause |
|---|---|---|
401 | missing API token | No key in the request |
401 | invalid API token | Key mistyped or deleted |
401 | API token is disabled | Key disabled by hand |
401 | API token has expired | Key past its expiry date |
401 | conflicting API credentials… | Different keys in several headers |
403 | API key is not allowed to use the requested model | Model not in this key's allowed list (code is API_KEY_MODEL_DENIED) |
402 | — | Balance too low (code is insufficient_funds) |
A key-related 401 body looks like:
json
{ "error": { "message": "invalid API token", "type": "proxy_error" } }Warning
Keys belong on the server. Shipping one in a browser, a mobile bundle or a public repo is the same as publishing your balance.
Contact us
Something unclear, or need a human? Pick the channel that fits your question.
Supportsupport@apione.ai
WeCom
Telegram
Communityhttps://t.me/apione
Support tickets
Billing & accountConsole › Feedback