Skip to main content
POST
Create API key
Requires keys:write scope. No idempotency.
The response includes the raw API key secret once. It can’t be retrieved again.
If you lose the response, list keys, revoke the orphan, and create a replacement.
With an API key, you can only create inference-profile keys. To create management keys, use the dashboard.
All parameters, request/response schemas, and examples are auto-generated from the OpenAPI specification.

Authorizations

Authorization
string
header
required

API key authentication. Keys start with ak_ prefix. Example: Authorization: Bearer ak_live_xxxxxxxxxxxx

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier

Body

application/json
name
string
required

Human-readable name for the key

Required string length: 1 - 255
key_type
enum<string>

Key type — api for inference

Available options:
api
scopes
string[]

Permission scopes to grant

rate_limit_rpm
integer

Per-key rate limit in requests per minute (minimum 1)

Required range: x >= 1
expires_at
string<date-time>

Expiration timestamp

budget
object

Budget configuration for an API key.

Response

Created

Created API key with the full secret value. The api_key field is returned only once and cannot be retrieved again.

id
string<uuid>
required

Unique identifier for the API key

workspace_id
string<uuid>
required

Workspace this key belongs to

name
string
required

Human-readable name for the key

key_prefix
string
required

Key prefix for identification

profile
enum<string>
required

Key profile derived from granted scopes

Available options:
inference,
management,
mixed
scopes
string[]
required

Granted permission scopes

is_active
boolean
required

Whether the key is currently active

created_at
string<date-time>
required

When the key was created

api_key
string
required

The full API key secret. Returned only on creation. Store it securely — it cannot be retrieved again.

rate_limit_rpm
integer | null

Per-key rate limit in requests per minute

expires_at
string<date-time> | null

Expiration timestamp

last_used_at
string<date-time> | null

When the key was last used

created_by_key_id
string<uuid> | null

ID of the API key that created this key

propagation_status
enum<string> | null

Status of edge propagation. Present when KV sync is pending.

Available options:
pending,
null