Skip to main content
Routeway’s key management endpoints let you create and configure API keys without visiting the dashboard. This is essential for automating key rotation, provisioning keys for new services, and enforcing per-key spending limits.
All endpoints on this page require a management key. Create one from Dashboard → Management Keys.
The full key value is only returned once — when you create it. After that, the key is masked in list and detail responses. Store it securely immediately after creation.

List All Keys

GET /v1/account/keys returns all API keys for your account with masked values.
Response:

Create a Key

POST /v1/account/keys creates a new API key with optional configuration.

Parameters

The full API key value is only returned in the creation response. Copy and store it in a secrets manager immediately — you cannot retrieve it again.

Get Key Details

GET /v1/account/keys/{key_id} returns detailed information about a specific key, including current usage.
Response:

Key Detail Fields


Update a Key

PATCH /v1/account/keys/{key_id} updates one or more settings on an existing key. Only include the fields you want to change.
Use updates to adjust limits dynamically — for example, increase a key’s daily_limit during a traffic spike, or tighten allowed_models for a service that should only use cheap models.

Delete a Key

DELETE /v1/account/keys/{key_id} permanently deletes a key. Any requests using this key will immediately start returning 401.
Response:
Deletion is permanent and immediate. Any application using this key will lose access instantly. Make sure to rotate keys gracefully — create the new key first, update your services, then delete the old one.

Key Rotation Pattern

A safe key rotation workflow:

Best Practices

Use descriptive labels

Name keys after the service or environment they belong to (e.g. "prod-backend", "staging-worker"). This makes it easy to audit usage.

Set daily limits

Always configure a daily_limit on production keys to prevent runaway costs from bugs or attacks.

Restrict models

Use allowed_models to limit expensive models to keys that actually need them. A chatbot key probably doesn’t need access to image generation models.

Rotate regularly

Rotate keys periodically (e.g. monthly) and immediately if a key may have been exposed.