Skip to main content
POST
curl

Authorizations

Authorization
string
header
required

An account provisioning key. Send it as Authorization: Bearer <key>. Provisioning keys manage the account and cannot reach a model.

Body

application/json

The body of POST /v1/account/keys.

name
string
required

A label for the key, between 1 and 255 characters.

credit_limit
number<double> | null

How many credits this key may spend before the gateway turns it away. Absent means no limit of its own.

expires_at
string | null

When the key should stop working; a past instant draws a refusal. Both grammars count.

default_routing_strategy
enum<string> | null

The routing strategy for requests that name none. Absent lets NagaAI choose. An unknown name draws a 400.

Available options:
reliability,
balanced,
latency,
throughput,
cache

Response

The freshly minted key, and the one answer carrying the secret itself.

The created key, and the only copy of its secret you will be given.

id
integer<int64>
required

The created key's id, which is the {key_id} the per-key routes take.

name
string
required

The label the request asked for.

key
string
required

The secret itself, in full, and the one answer carrying it.

created_at
string
required

When the key was created: UTC to the second, without an offset.

expires_at
string | null
required

When the key stops working, or null when the request asked for none.

is_enabled
boolean
required

Whether the key works at all. Creation inserts it enabled.

credit_limit
number<double> | null
required

The limit the request asked for, or null when it asked for none.

default_routing_strategy
enum<string> | null
required

The default routing strategy the request asked for, or null when NagaAI chooses.

Available options:
reliability,
balanced,
latency,
throughput,
cache
message
string
required

A fixed reminder that key above is shown once.