Dokumentation
ReferenceHTTP APIAPI KeysCreate an API key

Create an API key

POST
/v1/account/api-keys

Authorization

bearerAuth
AuthorizationBearer <token>

Authenticate using an API Key:

Authorization: Bearer rk_live_your-api-key

In: header

Request Body

application/json

name?string

Key name

Lengthlength <= 100
scopes?array<>

Permission scopes

Default["read","write"]
expires_in_days?integer

Validity period in days

Range1 <= value <= 365

Response Body

application/json

application/problem+json

application/problem+json

curl -X POST "https://api.routeany.com/v1/account/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "Production Key",    "scopes": [      "read",      "write"    ],    "expires_in_days": 90  }'
{
  "id": "key_01HXYZ...",
  "key": "rk_live_abc123...",
  "key_prefix": "rk_live_abc",
  "name": "Production Key",
  "scopes": [
    "read",
    "write"
  ],
  "rate_limit_rpm": 60,
  "is_active": true,
  "created_at": "2024-01-15T10:30:00Z",
  "expires_at": "2024-04-15T10:30:00Z"
}
{
  "type": "https://api.routeany.com/errors/validation-error",
  "title": "Validation Error",
  "status": 400,
  "detail": "The 'prompt' field is required",
  "code": "VALIDATION_INVALID_ARGUMENT",
  "errors": [
    {
      "field": "input.prompt",
      "code": "VALIDATION_MISSING_FIELD",
      "message": "prompt is required"
    }
  ]
}
{
  "type": "https://api.routeany.com/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing API key",
  "code": "AUTH_INVALID_TOKEN"
}