Skip to main content
POST
Create an AI Gateway API Key

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
expiresAt
string<date-time>

Token expiry timestamp. Omit for no expiry.

name
string

User-friendly label for this API key.

Maximum string length: 255
description
string

Human-readable description of this API key.

Maximum string length: 255
metadata
string

Arbitrary user-defined metadata for this API key.

Maximum string length: 4096
scopes
string[]

AI Gateway management scopes of the new key. At least one must manage the gateway. Each scope must be one that your own credential holds.

Minimum array length: 1

Response

The created AI Gateway API key.

id
string
required

Unique identifier for this API key.

uri
string
required

URI of this AI Gateway API Key API resource.

createdAt
string<date-time>
required

Timestamp when the API key was created.

updatedAt
string<date-time>
required

Timestamp when the API key was last updated.

createdBy
object
required
lastUpdatedBy
object
required
keyRedacted
string
required

Redacted display form of the API key token.

name
string

User-friendly label for this API key.

expiresAt
string<date-time>

Token expiry timestamp. Absent for keys with no expiry.

description
string

Human-readable description of this API key.

metadata
string

Arbitrary user-defined metadata for this API key.

token
string

Plaintext API key token. Only returned when the key is first created.

scopes
string[]

Scopes of an API key.

lastUsed
string<date-time> | null

Timestamp when the API key was last used.