API reference · Keys
Mint an API key
POST/api/keysSigned in session
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| namerequired | string | At most 60 characters. |
| orgId | integer or null | Mint for an organization instead of for yourself. |
| scopes | array of KeyScope | |
| expiresAt | integer or null | Unix ms. The key stops verifying here. |
| ipAllowlist | array of string | Addresses or CIDR blocks, either family. |
Example
{
"name": "string"
}Answer 201
The plaintext key. Store it now; it is only a hash from here on.
| Field | Type | What it is |
|---|---|---|
| key | string | Shown exactly once. |
| id | integer | |
| name | string | |
| prefix | string | |
| createdAt | integer | |
| orgId | integer or null | |
| scopes | array of KeyScope | |
| expiresAt | integer or null |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 403OpenAI shaped error.
- 409OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.