v51

OpenAPI 3.1.0raw.githubusercontent.com2026-08-018486293.2 KB
keys

Create Key

Create a new API key.

Requires master key authentication.

If user_id is provided, the key will be associated with that user (creates user if it doesn't exist). If user_id is not provided, the key is associated with the shared "default" user, which is created on first use. Keys without an explicit owner therefore share one identity, and so share budget, usage, and files.

post/v1/keys

Request body

allowed_modelsstring[] nullable

Model allow-list: null = any model, [] = deny all, or canonical instance:model entries (with instance:* / instance:prefix* wildcards).

exclude_from_budgetboolean

When true, requests on this key are logged with cost but never reserved, reconciled into the user's spend, or gated by budget.

expires_atstring date-time nullable

Optional expiration timestamp

key_namestring nullable

Optional name for the key

metadataobject

Optional metadata

user_idstring nullable

Optional user ID to associate with this key

Response

Successful Response

allowed_modelsstring[] nullable required
created_atstring required
exclude_from_budgetboolean required
expires_atstring nullable required
idstring required
is_activeboolean required
keystring required
key_namestring nullable required
key_prefixstring nullable required
metadataobject required
user_idstring nullable required