[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"article-doc:docs\u002Fapi-reference\u002Fadmin":3},"---\ntitle: Admin API\ndescription: Internal key management and plan catalog endpoints.\n---\nThese endpoints are for **internal operators and dashboards**, not for regular API consumers. All key-management routes require the `GATEWAY_ADMIN_TOKEN` via `Authorization: Bearer \u003Cadmin-token>`.\n\nThe single exception is `GET \u002Fv1\u002Fexternal-transcription\u002Fplans`, which is public and intended for SDK clients and dashboards that need to display plan limits.\n\n## Base URL\n\n```\nhttps:\u002F\u002Faudio.lansonai.com\n```\n\n## Authentication\n\n| Header | Value |\n|---|---|\n| `Authorization` | `Bearer \u003CGATEWAY_ADMIN_TOKEN>` |\n\nA missing or incorrect admin token returns:\n\n```json\n{\n  \"ok\": false,\n  \"error\": {\n    \"code\": \"admin_unauthorized\",\n    \"message\": \"Admin token required.\",\n    \"retryable\": false\n  }\n}\n```\n\n## Response envelope\n\nAll admin endpoints use the same envelope:\n\n```json\n{\n  \"ok\": true,\n  \"data\": { ... }\n}\n```\n\nErrors:\n\n```json\n{\n  \"ok\": false,\n  \"error\": {\n    \"code\": \"...\",\n    \"message\": \"...\",\n    \"retryable\": false\n  }\n}\n```\n\n## Endpoints\n\n### `GET \u002Fv1\u002Fexternal-transcription\u002Fplans`\n\nPublic. Returns every known plan and its resolved limits.\n\n```bash\ncurl https:\u002F\u002Faudio.lansonai.com\u002Fv1\u002Fexternal-transcription\u002Fplans\n```\n\nResponse:\n\n```json\n{\n  \"ok\": true,\n  \"data\": [\n    {\n      \"plan\": \"free\",\n      \"limits\": {\n        \"maxConcurrentConnections\": 1,\n        \"maxConcurrentUtterances\": 2,\n        \"maxConnectionsPerMinute\": 6,\n        \"maxRequestsPerMinute\": 12,\n        \"maxAudioSecondsPerRequest\": 900,\n        \"maxSessionSeconds\": 900,\n        \"maxAudioSecondsPerSession\": 900,\n        \"maxAudioSecondsPerWindow\": 3600,\n        \"idleTimeoutSeconds\": 60\n      }\n    }\n  ]\n}\n```\n\n### `POST \u002Fv1\u002Fexternal-transcription\u002Fkeys`\n\nIssue a new API key. The **plaintext key is returned exactly once** in the response; after that only metadata and a hash are stored.\n\n```bash\ncurl -X POST https:\u002F\u002Faudio.lansonai.com\u002Fv1\u002Fexternal-transcription\u002Fkeys \\\n  -H \"Authorization: Bearer \u003Cadmin-token>\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"owner_id\": \"tenant_a\",\n    \"plan\": \"pro\",\n    \"label\": \"production\",\n    \"expires_at\": \"2026-12-31T23:59:59Z\"\n  }'\n```\n\nRequest fields:\n\n| Field | Type | Required | Description |\n|---|---|---|---|\n| `owner_id` | string | no | Tenant identifier (default: `default`) |\n| `plan` | string | no | Plan name (default: `free`) |\n| `label` | string | no | Human-readable label |\n| `expires_at` | string (ISO 8601) | no | Expiration timestamp |\n\nResponse:\n\n```json\n{\n  \"ok\": true,\n  \"data\": {\n    \"key\": \"sk-...\",\n    \"id\": \"...\",\n    \"ownerId\": \"tenant_a\",\n    \"keyPrefix\": \"sk-xxxxxxxxx\",\n    \"lastFour\": \"abcd\",\n    \"plan\": \"pro\",\n    \"status\": \"active\",\n    \"label\": \"production\",\n    \"expiresAt\": \"2026-12-31T23:59:59Z\",\n    \"revokedAt\": null,\n    \"lastUsedAt\": null,\n    \"createdAt\": \"2026-08-16T...\",\n    \"limits\": { ... }\n  }\n}\n```\n\n### `GET \u002Fv1\u002Fexternal-transcription\u002Fkeys`\n\nList key metadata. Optionally filter by `?owner_id=`.\n\n```bash\ncurl https:\u002F\u002Faudio.lansonai.com\u002Fv1\u002Fexternal-transcription\u002Fkeys \\\n  -H \"Authorization: Bearer \u003Cadmin-token>\"\n```\n\nResponse:\n\n```json\n{\n  \"ok\": true,\n  \"data\": [\n    { \"id\": \"...\", \"ownerId\": \"tenant_a\", \"plan\": \"pro\", \"status\": \"active\", ... }\n  ]\n}\n```\n\n### `GET \u002Fv1\u002Fexternal-transcription\u002Fkeys\u002F{id}`\n\nInspect a single key.\n\n```bash\ncurl https:\u002F\u002Faudio.lansonai.com\u002Fv1\u002Fexternal-transcription\u002Fkeys\u002F\u003Cid> \\\n  -H \"Authorization: Bearer \u003Cadmin-token>\"\n```\n\n### `DELETE \u002Fv1\u002Fexternal-transcription\u002Fkeys\u002F{id}`\n\nRevoke a key.\n\n```bash\ncurl -X DELETE https:\u002F\u002Faudio.lansonai.com\u002Fv1\u002Fexternal-transcription\u002Fkeys\u002F\u003Cid> \\\n  -H \"Authorization: Bearer \u003Cadmin-token>\"\n```\n\n## Error codes\n\n| Code | HTTP | Description |\n|---|---|---|\n| `admin_unauthorized` | 401 | Missing or incorrect admin token |\n| `invalid_plan` | 400 | Unknown plan name |\n| `key_not_found` | 404 | Key ID does not exist |\n| `issue_failed` | 500 | Unable to issue a key |\n| `store_unavailable` | 500 | R2 key store unavailable |\n| `not_found` | 404 | Unknown admin route |\n\n## Related\n\n- [Authentication](\u002Fdocs\u002Fstart\u002Fauthentication) — regular API key and session-token flow\n- [Rate Limits](\u002Fdocs\u002Fapi-reference\u002Frate-limits) — plan limits returned by `\u002Fplans`\n",1790059118945]