Get started
Authentication
How AZRouter API keys work and which headers carry them.
Keep your key here
Authorization: Bearer <key>
Checks your API key
- Your server. Keep your key here
- Request header. Authorization: Bearer <key>
- AZRouter. Checks your API key
Every request carries one AZRouter API key.
API keys
| Format | sk-... | 51 characters: sk- and 48 letters or digits. |
|---|---|---|
| Shown | Once | At creation. Copy it then; it can't be shown again. |
| Scope | Your account | All keys on an account share its credits and rate limits. |
| Revoke | Any time | In Dashboard → API keys. A revoked key gets 401. |
Headers
Send the key as a bearer token.
This works on every endpoint, including /v1/messages.
curl https://api.azrouter.dev/v1/models \
-H "Authorization: Bearer $AZROUTER_API_KEY"Anthropic clients send the key in x-api-key instead.
AZRouter accepts that header on /v1/messages:
curl https://api.azrouter.dev/v1/messages \
-H "x-api-key: $AZROUTER_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "qwen/qwen3.8-flash", "max_tokens": 200, "messages": [{"role": "user", "content": "Reply with exactly: Hello from AZRouter"}]}'A missing or wrong key
The gateway answers 401 invalid_api_key.
The same 401 comes back for a revoked key, and for keys switched off once your spending reached your tier's monthly cap.
A key that reached its own spending limit gets 403 access_denied instead; see Errors.
curl https://api.azrouter.dev/v1/models \
-H "Authorization: Bearer sk-not-a-real-key"{"error":{"message":"Invalid or expired API key.","type":"authentication_error","code":"invalid_api_key"},"request_id":"..."}Keep keys on the server
Never ship a key inside a browser or mobile app.
Anyone who reads it can spend your credits.