API reference

API reference · Keys

Mint an API key

POST/api/keysSigned in session

Request body

application/json, required

Request body fields
FieldTypeWhat it is
namerequiredstringAt most 60 characters.
orgIdinteger or nullMint for an organization instead of for yourself.
scopesarray of KeyScope
expiresAtinteger or nullUnix ms. The key stops verifying here.
ipAllowlistarray of stringAddresses or CIDR blocks, either family.

Example

{
  "name": "string"
}

Answer 201

The plaintext key. Store it now; it is only a hash from here on.

Fields of the 201 answer
FieldTypeWhat it is
keystringShown exactly once.
idinteger
namestring
prefixstring
createdAtinteger
orgIdinteger or null
scopesarray of KeyScope
expiresAtinteger or null

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 409OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter