API Reference
API keys
Create and manage API keys for programmatic access
Was this page helpful?
⌘I
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create and manage API keys for programmatic access
GET /api/keys
{
"keys": [
{
"id": "key_123",
"name": "Production Key",
"keyPreview": "sk_abc1234...",
"createdAt": "2026-03-01T00:00:00Z",
"lastUsed": "2026-03-19T00:00:00Z"
}
]
}
POST /api/keys
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Key name (max 64 characters) |
{
"id": "key_456",
"name": "Production Key",
"key": "sk_a1b2c3d4e5f6...",
"createdAt": "2026-03-19T00:00:00Z"
}
| Code | Description |
|---|---|
| 400 | Name required or name too long (max 64 characters) |
| 401 | Unauthorized |
| 500 | Failed to create key |
GET /api/keys/:id
{
"id": "key_123",
"name": "Production Key",
"keyPreview": "sk_abc1234...",
"createdAt": "2026-03-01T00:00:00Z",
"lastUsed": "2026-03-19T00:00:00Z"
}
| Code | Description |
|---|---|
| 401 | Unauthorized |
| 404 | Key not found |
DELETE /api/keys/:id
{
"success": true
}
| Code | Description |
|---|---|
| 401 | Unauthorized |
| 404 | Key not found |
Was this page helpful?