Authentication & API keys
Create a key
- Open Settings → API keys
In the console, choose the organization in the top-left switcher, then open Settings → API keys.
- Choose a name, scope and expiry
Names like
ci-deployorprod-inferencemake the audit log readable. Expiry is optional (30, 90 or 365 days). - Copy the key
The full key (
ak_live_followed by 40 characters) is shown once. We store only a hash and show the prefix (e.g.ak_live_4f9c) afterwards.
You can also create keys with the API keys endpoint or apipods api-keys create.
Scopes
| Scope | Allows |
|---|---|
READ | GET requests on the control plane, plus /status, /stream and /health on the runtime API. |
READ_WRITE | Everything, including creating pods, deploying endpoints and submitting jobs with /run and /runsync. |
A key can never do more than its owner's team role allows. A VIEWER can only create READ keys, and a key created by a DEVELOPER cannot read billing data.
Use the key
Send the key in the Authorization header. The CLI and SDKs read it from APIPODS_API_KEY.
curl https://api.apipods.com/v1/pods \
-H "Authorization: Bearer $APIPODS_API_KEY"Rotate and revoke
Rotate creates a new key with the same name and scope and keeps the old one valid for 24 hours, so you can roll it out without downtime. Revoke invalidates a key immediately. Revoked and expired keys return 401.
| Status | Code | Meaning |
|---|---|---|
401 | missing_api_key | No Authorization header was sent. |
401 | invalid_api_key | The key is malformed or does not exist. |
401 | revoked_api_key | The key was revoked or has expired. |
Best practices
- Use one key per application and environment so you can revoke it without collateral damage.
- Never ship keys to browsers or mobile apps. Call the runtime API from your backend and forward the result.
- Store keys in a secrets manager or CI secret, not in source control or Docker images.
- Prefer
READkeys for dashboards and monitoring. - If a key leaks, revoke it in the console and check Settings → Audit log for activity.