Skip to main content

API tokens

All /v1/ endpoints authenticate via an API token. Tokens:
  • Start with the prefix ab_
  • Are 51 characters long
  • Are scoped to a single organization
  • Never expire (but can be revoked instantly)
Create a token: Dashboard → Settings → API tokens → New token. API token access requires the Team plan. The token value is shown only once at creation — store it in a secrets manager or environment variable immediately.

Authorization header

Pass your token in the Authorization header on every request:
Requests without a valid token return 401 unauthorized.

Check your balance

Before submitting compute jobs, verify your credit balance with:
See Credits for the full cost table and how to buy additional credits.

Rate limits

Every /v1/ response carries rate-limit headers: Reads (GET) consume the rate bucket but do not count against your monthly write quota — polling for job status is free. Writes (POST/PATCH/DELETE) consume both the rate bucket and the quota. Pipeline submits additionally spend credits. When you hit a limit the API returns 429 with a Retry-After header giving the seconds until the window resets.

Errors

All error responses use RFC 9457 problem+json with Content-Type: application/problem+json.
Switch on the code field — it is stable across API versions.

Python SDK error handling

Idempotency

All write endpoints accept an Idempotency-Key header. Send a unique UUID per logical operation — replayed requests with the same key return the cached response without creating a duplicate job or spending credits twice.
Keys expire after 24 hours. Sending the same key with a different request body returns 422 idempotency_mismatch.