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 protocol

Send 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

StatusmessageTypical cause
401missing API tokenNo key in the request
401invalid API tokenKey mistyped or deleted
401API token is disabledKey disabled by hand
401API token has expiredKey past its expiry date
401conflicting API credentials…Different keys in several headers
403API key is not allowed to use the requested modelModel 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.