API Keys

Create an API key

Creates a site key and returns its token. Keys made through the API always have origin api. A key's kind can't be set through the API: sending kind returns 422 invalid_params. Full-access keys are created in the dashboard only.

An account can have up to 10,000 active site keys. Past that, creating returns 422 site_key_cap_reached. The name of a connected integration, such as the Webflow Designer key or a connected Shopify store, is reserved: 422 reserved_name.

Send an Idempotency-Key header to retry safely.

post/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

Headers

Idempotency-Keystring

A unique string you generate, such as a UUID. Retrying the same request with the same Idempotency-Key within 24 hours returns the original result instead of creating or rotating a second time. A retry is the same request only when the path and body match; otherwise you get idempotency_key_reused. A replay returns the token only while it is still the key's current token. After a later rotation or revocation it returns 409 idempotent_replay_superseded instead. A request that failed is not stored, so retrying it runs again.

Request body

namestring required

A name for the key. Required.

usage_limitinteger nullable

[optional] The recorded-usage threshold that stops new requests this billing period. In-flight work can still be charged beyond it. Omit or send null for no limit.

Response

The new key, with its token.

idinteger
namestring
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'
tokenstring 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_hintstring nullable

The last four characters of the token, or null once the key is revoked.

usage_limitinteger 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_usedinteger

Credits this key has used this period, counted against usage_limit.

billable_creditsinteger

Every credit charged to the account through this key this period, whether or not the charge crossed the key's limit.

billable_completeboolean

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_startstring date-time nullable

When the current period started, if the key has been reset.

resets_atstring date-time nullable

When the account's current billing period ends, or null when it has no active subscription with a renewal date.

created_atstring date-time
last_used_atstring date-time nullable
revoked_atstring date-time nullable

Changes

No recorded changes to this operation across all 1 revision of this API.