Overview
Creates a newtype=user API key in the organization associated with the current management token.
Request Body
| Field | Type | Default / Limits | Notes |
|---|---|---|---|
name | string | required, default Default Key, length 1-50 | Display name, trimmed server-side |
limitAmount | number | null | min 0, input max 1000000 | null or omitted = unlimited, 0 = zero quota. Positive values are normalized to a stored cap that cannot exceed 100000 USD equivalent. |
limitCurrency | enum | default USD | USD only. Sending CNY returns 400 currency_retired. |
models | string[] | default [] | Optional model allowlist |
expiresAt | string | null | RFC3339 datetime | null means no expiry |
Notes
-
Monetary fields are USD-only.
CNYinputs are retired and return400 currency_retired. - The full API key value is shown only once in the response.
-
models: []means the key has no additional model restriction beyond organization policy. -
limitAmount: 0creates a key that is valid but cannot spend quota until updated.
Example
Request / Response
Use the interactive OpenAPI panel above for the exact schema and response fields.Response example
Important fields
Full secret API key value. It is returned only once on creation.
API key identifier used in follow-up Management API calls.
Display name for the API key.
Non-secret key prefix for display and support.
One of
active, inactive, or revoked.Spending cap in USD as a JSON number for display.
null means unlimited.Exact spending cap in USD as a decimal string.
null means unlimited.Accumulated usage in USD as a JSON number for display.
Exact accumulated usage in USD as a decimal string.
Per-key model allowlist. Empty array means no additional key-level model restriction.
ISO timestamp when the key expires, or
null for no expiry.ISO timestamp for the most recent use, or
null when unused.ISO creation timestamp.