Admin API

Internal key management and plan catalog endpoints.

These endpoints are for internal operators and dashboards, not for regular API consumers. All key-management routes require the GATEWAY_ADMIN_TOKEN via Authorization: Bearer <admin-token>.

The single exception is GET /v1/external-transcription/plans, which is public and intended for SDK clients and dashboards that need to display plan limits.

Base URL

https://audio.lansonai.com

Authentication

HeaderValue
AuthorizationBearer <GATEWAY_ADMIN_TOKEN>

A missing or incorrect admin token returns:

{
  "ok": false,
  "error": {
    "code": "admin_unauthorized",
    "message": "Admin token required.",
    "retryable": false
  }
}

Response envelope

All admin endpoints use the same envelope:

{
  "ok": true,
  "data": { ... }
}

Errors:

{
  "ok": false,
  "error": {
    "code": "...",
    "message": "...",
    "retryable": false
  }
}

Endpoints

GET /v1/external-transcription/plans

Public. Returns every known plan and its resolved limits.

curl https://audio.lansonai.com/v1/external-transcription/plans

Response:

{
  "ok": true,
  "data": [
    {
      "plan": "free",
      "limits": {
        "maxConcurrentConnections": 1,
        "maxConcurrentUtterances": 2,
        "maxConnectionsPerMinute": 6,
        "maxRequestsPerMinute": 12,
        "maxAudioSecondsPerRequest": 900,
        "maxSessionSeconds": 900,
        "maxAudioSecondsPerSession": 900,
        "maxAudioSecondsPerWindow": 3600,
        "idleTimeoutSeconds": 60
      }
    }
  ]
}

POST /v1/external-transcription/keys

Issue a new API key. The plaintext key is returned exactly once in the response; after that only metadata and a hash are stored.

curl -X POST https://audio.lansonai.com/v1/external-transcription/keys \
  -H "Authorization: Bearer <admin-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "owner_id": "tenant_a",
    "plan": "pro",
    "label": "production",
    "expires_at": "2026-12-31T23:59:59Z"
  }'

Request fields:

FieldTypeRequiredDescription
owner_idstringnoTenant identifier (default: default)
planstringnoPlan name (default: free)
labelstringnoHuman-readable label
expires_atstring (ISO 8601)noExpiration timestamp

Response:

{
  "ok": true,
  "data": {
    "key": "sk-...",
    "id": "...",
    "ownerId": "tenant_a",
    "keyPrefix": "sk-xxxxxxxxx",
    "lastFour": "abcd",
    "plan": "pro",
    "status": "active",
    "label": "production",
    "expiresAt": "2026-12-31T23:59:59Z",
    "revokedAt": null,
    "lastUsedAt": null,
    "createdAt": "2026-08-16T...",
    "limits": { ... }
  }
}

GET /v1/external-transcription/keys

List key metadata. Optionally filter by ?owner_id=.

curl https://audio.lansonai.com/v1/external-transcription/keys \
  -H "Authorization: Bearer <admin-token>"

Response:

{
  "ok": true,
  "data": [
    { "id": "...", "ownerId": "tenant_a", "plan": "pro", "status": "active", ... }
  ]
}

GET /v1/external-transcription/keys/{id}

Inspect a single key.

curl https://audio.lansonai.com/v1/external-transcription/keys/<id> \
  -H "Authorization: Bearer <admin-token>"

DELETE /v1/external-transcription/keys/{id}

Revoke a key.

curl -X DELETE https://audio.lansonai.com/v1/external-transcription/keys/<id> \
  -H "Authorization: Bearer <admin-token>"

Error codes

CodeHTTPDescription
admin_unauthorized401Missing or incorrect admin token
invalid_plan400Unknown plan name
key_not_found404Key ID does not exist
issue_failed500Unable to issue a key
store_unavailable500R2 key store unavailable
not_found404Unknown admin route