Create an API Key
Create a Regular API Key.
Request Parameters
| Field | Required | Type | Description |
|---|---|---|---|
name | Yes | string | Key name, 1–50 characters after trimming leading/trailing whitespace |
key_type | No | string | Can only be regular |
limit | No | number | Dollar limit; omitted or 0 means no limit |
limit_reset | No | string | never, daily, weekly, monthly; default never |
model_allowlist | No | string[] | Model allowlist, up to 1000 items |
model_blocklist | No | string[] | Model blocklist, up to 1000 items |
disabled | No | boolean | Whether to create in a manually disabled state; default false |
Response Example (HTTP 201 Created)
{
"id": "key_01j...",
"name": "qa-automation",
"key_type": "regular",
"key": "sk-...",
"key_preview": "sk-abcd**********wxyz",
"disabled": false,
"created_at": "2026-08-04T08:00:00Z"
}
key is the full Regular API Key and is returned only once in the create response. Store it immediately in a secure key management system or environment variable. Do not record it in logs, screenshots, or documentation.
The create endpoint supports the Idempotency-Key header. Replaying with the same Management Key, idempotency key, and an equivalent request within 24 hours returns the same ID and the same full key without creating a duplicate; after 24 hours but within 30 days it returns 409 idempotency_expired.
For general request conventions, data structures, and error codes, see the Key Management API overview.