Create key
POST/v1/account/keys
Creates an API key and returns it, once. Needs the account scope as an owner or admin.
- scope
- account
- auth
- Bearer key
- operationId
- CreateKey
Request body
application/json · KeyRequest · no other fields
| Field | Type | Required | Limits | Holds |
|---|---|---|---|---|
| scopes | read · write_requests · account[] | yes | 1 to 3 items | |
| max_mode | strict · standard · broad | no | Which items could be served. Each mode returns everything the one before it does. | |
| name | string | no | 1 to 100 characters | A name for the key, shown in the console. |
| preset | string | no | 1 to 64 characters |
Response
201 · NewKey. The key. It is shown only now.
| Field | Type |
|---|---|
| key | string |
| info | KeyInfo |
Problems
RFC 9457 application/problem+json. An abstention is not one of these: it is a 200.
| HTTP | Code | When |
|---|---|---|
| 400 | INVALID_REQUEST | Malformed JSON, unknown fields, bad filter, limit exceeded |
| 401 | UNAUTHENTICATED | Missing, malformed, or revoked key |
| 403 | FORBIDDEN_SCOPE | The key lacks the required scope |
| 404 | NOT_FOUND | Unknown response, job, document, or reserved route |
| 422 | UNPROCESSABLE | Well-formed but semantically invalid |
| 429 | RATE_LIMITED | Rate limit or per-tenant model cap |
| 500 | INTERNAL, POLICY_ASSERT_FAILED, RESPONSE_UNREPLAYABLE | Server fault. The last two also alert |
| 503 | STORE_UNAVAILABLE, LLM_UNAVAILABLE, LOG_UNAVAILABLE | A dependency is down or a budget tripped |