Authentication
Use one AllModels API key for authenticated requests.
Headers
Send your AllModels API key as a Bearer token. Model and provider discovery at
GET /v1/models and GET /v1/providers is public; inference, account, and
voice-discovery endpoints require authentication.
const response = await fetch("https://api.allmodels.io/account/balance", { method: "GET", headers: { Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}`, },});if (!response.ok) throw new Error(`AllModels request failed: ${response.status}`);console.log(await response.json());SDK auth
Configure the ElevenLabs or OpenAI SDK with your AllModels API key and the matching AllModels base URL.
Configure ElevenLabs auth in Python
import os
from elevenlabs.client import ElevenLabs
client = ElevenLabs(
api_key=os.environ["ALLMODELS_API_KEY"],
base_url="https://api.allmodels.io/el",
)Auth errors
| Error | Status | Retry? | Meaning |
|---|---|---|---|
missing_api_key | 401 | No | No key was supplied. |
invalid_api_key | 401 | No | The key is unknown, revoked, or malformed. |
tenant_disabled | 403 | No | The key belongs to a disabled tenant. |
provider_not_allowed | 403 | No | The key cannot use the selected provider. |
insufficient_balance | 402 | No | The key cannot start the request because prepaid balance is too low. |
