Authentication
Authenticate server-side requests with a project API key. Public catalog reads also work anonymously at lower limits.
Use an API key
Send the key as a bearer token on every authenticated request. Keys are scoped to a project and environment, so use distinct keys for development and production.
cURL
curl https://api.use-allm.com/v1/deployments?limit=1 \
-H "Accept: application/json" \
-H "Authorization: Bearer $ALLM_API_KEY"Server-side only
Never embed an ALLM secret key in browser code, mobile binaries, public repositories, logs, or support messages. Call ALLM from your server or an authenticated backend route.
SDK configuration
TypeScript
import { ALLM } from "@allm/sdk";
const allm = new ALLM({
apiKey: process.env.ALLM_API_KEY,
timeoutMs: 10_000,
});Python
import os
from allm import ALLM
allm = ALLM(
api_key=os.environ["ALLM_API_KEY"],
timeout=10.0,
)Keep keys secure
- Load keys from a secrets manager or environment variable.
- Rotate a key immediately if it may have been exposed.
- Use the narrowest project and environment scope available.
- Do not use a production key in local development or CI logs.
Troubleshooting
| Status | Code | When it happens |
|---|---|---|
| 401 | UNAUTHORIZED | The key is missing, malformed, revoked, or invalid for this environment. |
| 403 | FORBIDDEN | The key is valid but does not have access to the requested tenant resource. |
| 429 | RATE_LIMIT_EXCEEDED | The request quota is exhausted. Honor Retry-After before retrying. |