OpenRCS API reference · v1 ← Back to console Swagger UI
Accounts

Create an additional API key

POST /account/api-keys bearer_auth

Creates a new API key for the calling account and links it to the account's per-tier usage plan. The key value is returned **only here** and re-readable via `GET /account/api-keys/{key_id}` — it is never stored in the relay's database and never appears in `GET /account/api-keys`. The returned `id` (the API key id) is the key's unique, stable identifier and the handle for the per-key routes. The optional `name` (1–64 chars of `A-Za-z0-9._-`) is a free-form label: it MAY repeat (duplicate names are allowed); when omitted the key defaults to `key-<lowest free n>`. Limits: at most 20 active keys per account (`409` above). Requires `status: ready`.

Parameters

NameInTypeRequiredDescription
Authorization header string yes `Bearer <token>` obtained from `POST /login`.

Request body

FieldTypeRequiredDescription
name string no

Responses

StatusDescription
200 Key created (value returned only on create).
400 Invalid name or malformed JSON body.
401 Missing or invalid credentials.
404 Account not found.
409 20-active-key limit reached (`max 20 active keys`), account not ready yet (`account not ready`), a concurrent create claimed the last active-key slot first (`max active keys reached` — the rail is enforced atomically at the storage layer), or the account's stored tier is not provisionable (`unsupported account tier: <tier>; contact support` — the stored tier has no provisionable usage plan; contact support).
503 API key store is being migrated; try again later.
502 Internal error while provisioning the key.

200 example

{
  "id": "ak_2",
  "name": "key-2",
  "api_key_value": "sk_live_xxx",
  "created_at": "2026-09-16T12:00:00Z"
}