Docs / Get started

Authentication & API keys

All API requests are authenticated with an API key sent as a bearer token. Keys belong to a user in an organization and carry a scope.

Create a key

  1. Open Settings → API keys

    In the console, choose the organization in the top-left switcher, then open Settings → API keys.

  2. Choose a name, scope and expiry

    Names like ci-deploy or prod-inference make the audit log readable. Expiry is optional (30, 90 or 365 days).

  3. 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

ScopeAllows
READGET requests on the control plane, plus /status, /stream and /health on the runtime API.
READ_WRITEEverything, 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.

StatusCodeMeaning
401missing_api_keyNo Authorization header was sent.
401invalid_api_keyThe key is malformed or does not exist.
401revoked_api_keyThe 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 READ keys for dashboards and monitoring.
  • If a key leaks, revoke it in the console and check Settings → Audit log for activity.