---
title: "List API keys"
method: GET
path: "/api_keys"
tags: ["API Keys"]
---

# List API keys

`GET /api_keys`

## Request

- Base URL: `https://alttext.ai/api/v1`
- URL: `https://alttext.ai/api/v1/api_keys`
- Auth: API key in header `X-API-Key`

Lists the account's site keys, oldest first, with cursor pagination. Needs a full-access key.
Tokens are included. The response is sent with `Cache-Control: no-store`.

## Query parameters

- `status` 'active' | 'revoked' | 'all'
- `q` string
- `after` string
- `limit` integer

## Response `200`

A page of keys.

- ApiKeyList
  - `api_keys` ApiKey[]
    - `id` integer
    - `name` string
    - `kind` 'site': Always `site` here. Full-access keys are created and managed in the dashboard only.
    - `origin` 'unknown' | 'dashboard' | 'api' | 'shopify' | 'bigcommerce' | 'wordpress_connect': Where the key was created.
    - `integration` 'shopify' | 'bigcommerce' | 'wordpress_connect' | 'null', nullable: The integration that created and uses this key, or `null`. Rotating or revoking an integration key stops that integration until it reconnects.
    - `status` 'active' | 'revoked'
    - `token` string, nullable: The key's token, or `null` once the key is revoked or when an assistant connection without write access reads it. Tokens begin with `atai_`. Keys created before that format existed keep their original tokens, which stay valid. Treat the token as a secret.
    - `token_hint` string, nullable: The last four characters of the token, or `null` once the key is revoked.
    - `usage_limit` integer, nullable: The recorded-usage threshold that stops new requests this billing period. In-flight work can still be charged beyond it. `null` means no limit.
    - `credits_used` integer: Credits this key has used this period, counted against `usage_limit`.
    - `billable_credits` integer: Every credit charged to the account through this key this period, whether or not the charge crossed the key's limit.
    - `billable_complete` boolean: Whether every charge in the current period was tracked by the billing-aware release after the operator's verified old-task drain cutoff. False when tracking is incomplete or the cutoff is absent.
    - `period_start` string, date-time, nullable: When the current period started, if the key has been reset.
    - `resets_at` string, date-time, nullable: When the account's current billing period ends, or `null` when it has no active subscription with a renewal date.
    - `previous_period` ApiKeyPreviousPeriod: The credits billed through the key in its last closed period. `null` until the key has had a reset or been revoked.
      - `billable_credits` integer: Every credit charged to the account through this key during that period, whether or not the charge crossed the key's limit.
      - `billable_complete` boolean: `false` when the period started or was recorded before billable credits were tracked, so the number can be low.
      - `recorded_at` string, date-time: When the period closed.
    - `created_by` ApiKeyCreator: Who created the key, from the audit trail. `null` for keys that predate the audit trail.
      - `type` 'user' | 'api_key' | 'mcp_connection' | 'system'
      - `name` string, nullable
    - `created_at` string, date-time
    - `last_used_at` string, date-time, nullable
    - `revoked_at` string, date-time, nullable
  - `next_cursor` string, nullable: Pass as `after` to get the next page. `null` on the last page.
  - `has_more` boolean

## Other responses

- `403`: The request was refused. `error_code` is one of: - `invalid_api_key`: the `X-API-Key` header is missing or doesn't match a key. - `api_key_revoked`: the key was revoked. Create a new key. - `full_access_required`: managing keys needs a full-access key. Create one in the dashboard under Account > API Keys. - `insufficient_scope`: an assistant connection lacks the Manage API keys permission (`required_scope` is `mcp:keys`), or read-only access when changing keys or revealing a token (`mcp:write`). Reconnect with the permission. - `credential_no_longer_authorized`: the account closed or the calling credential lost authority before the mutation acquired its lock. Reconnect or use a current full-access key. - `out_of_scope`: this key can't be used for this request.
- `422`: Invalid `status` or `after`. `error_code` is `invalid_params`.
- `429`: Too many key requests for this account. The limit is 120 reads and 30 changes per minute, counted per account across all the API Keys endpoints. Wait `Retry-After` seconds. `error_code` is `rate_limited`.

---

[API](https://skmtc.dev/alttext/apis/alttext-ai-api.md) · [All operations](https://skmtc.dev/alttext/apis/alttext-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/alttext/apis/alttext-ai-api/revisions/6eb62e8e450c?raw)
