Skip to main content
POST
Create a customer key

Authorizations

Authorization
string
header
required

Your AI Reserve API key (aireserve_api_…) from the API Keys page in the portal (https://portal.aireserve.com/keys).

Path Parameters

customerId
string
required

Your end-customer id, URL-encoded — the same opaque id you would otherwise send as x-aireserve-customer (1–128 printable characters).

Required string length: 1 - 128

Body

application/json
name
string

Display name for the key. Defaults to the customer id (and org id for a sub key).

Required string length: 1 - 255
org_id
string

The customer's organization / sub-account. When set the key is a sub key: usage is reported under the customer AND this organization.

Required string length: 1 - 128

Response

Key created. Store key now — it is never shown again.

id
string<uuid>
required

Key id — the {keyId} for DELETE.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
name
string | null
required
customer_id
string
required

Your end-customer id, exactly as given in the path.

org_id
string | null
required

The customer's organization for a sub key; null for a customer-level key.

key_prefix
string
required

First characters of the key, for telling keys apart in a list.

key_suffix
string
required

Last characters of the key.

status
enum<string>
required

active serves requests; paused was stopped by a spending guardrail or an admin and can be resumed in the portal; revoked is permanent.

Available options:
active,
paused,
revoked
created_at
string<date-time>
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
last_used_at
string<date-time> | null
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
revoked_at
string<date-time> | null
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
key
string
required

The plaintext API key. Shown exactly once — store it now; only a hash is kept.