API keys

Create key

Mint a bearer API key for the CLI, agents, and MCP; the key is returned once. Session only, so a leaked key cannot mint keys.

POST/v1/api-keysSession

Authorization

The browser session cookie gpu_router_session only. Bearer keys are not accepted here.

Body

namestringrequired

Responses

201application/json

The new key. The key field is shown in this response only; later listings show the prefix.

Show response attributes
idstringrequired
namestringrequired
prefixstringrequired
keystringrequired

The full key, returned once. Send it as Authorization: Bearer <key>.

created_atstring<date-time>required
401application/json

UNAUTHENTICATED: missing, invalid, expired, or revoked session or API key.

UNAUTHENTICATED
403application/json

DEMO_ACCOUNT_LIMITED: a demo account already has its maximum of API keys. CSRF_ORIGIN_MISMATCH as for any write.

DEMO_ACCOUNT_LIMITEDCSRF_ORIGIN_MISMATCH
422application/json

VALIDATION_ERROR: malformed body, or name is blank or longer than 100 characters after stripping surrounding whitespace. Nothing is stored.

VALIDATION_ERROR
429application/json

RATE_LIMITED (retryable): the signed-in user made more than GPU_ROUTER_RATE_PER_MINUTE mutating requests in the last minute. Nothing was changed.

RATE_LIMITED
500application/json

Unexpected failure: INTERNAL_ERROR.

INTERNAL_ERROR
502application/json

AUTH_PROVIDER_REJECTED: the provider refused the request (not retryable).

AUTH_PROVIDER_REJECTED
503application/json

AUTH_NOT_CONFIGURED (not retryable) or AUTH_PROVIDER_UNAVAILABLE (retryable).

AUTH_NOT_CONFIGUREDAUTH_PROVIDER_UNAVAILABLE