Create API Key

Create a tenant API key.

POST/v1/customer/api-keys

Request Parameters

NameTypeRequiredDescription
name
stringRequiredHuman-readable key label (max 100 chars).
expires_in_days
integerOptional expiration offset in days.

Request Example

bash
curl -X POST https://api.therouter.ai/v1/customer/api-keys
  -H "Authorization: Bearer $THEROUTER_API_KEY"
  -H "Content-Type: application/json"
  -d '{
    "name": "backend-prod",
    "expires_in_days": 30
  }'

Response

json
{
  "id": "4d953cc1-b4d5-45fd-9d51-0f0a6e2ec7d8",
  "name": "backend-prod",
  "api_key": "sk-2F8A8OU8Q0zv0V8b5d4uQ0vR8J62m9pZ4F8Y8K0mQ2Y",
  "key_preview": "a8c9X2zQ",
  "expires_at": "2026-03-27T08:30:00.000Z",
  "created_at": "2026-02-26T08:30:00.000Z"
}
Notes
Persist api_key immediately. It is shown only once.