Skip to main content
PATCH
Set an API key spending limit

Authorizations

Authorization
string
header
required

Session token from signing in, sent as Authorization: Bearer <token>.

Path Parameters

workspace_id
string
required

The workspace id (a UUID).

key_id
string
required

The API key id (a UUID).

Body

application/json

Request to update API key spend limit

spendLimit
null | object

The new spending limit; null removes the limit.

Response

The updated key.

An API key.

created_at
string<date-time>
required
created_by_user_id
string
required

The user who created the key.

id
string
required

The key's id (a UUID).

is_active
boolean
required

Whether the key can be used.

key_prefix
string
required

The first characters of the key, for recognizing it.

workspace_id
string
required

The workspace the key belongs to.

deleted_at
string<date-time> | null
expires_at
string<date-time> | null

When the key stops working, if it expires.

key
string | null

The full secret key, beginning with sk-. It is returned only in the response that creates the key and cannot be retrieved again; store it securely.

last_used_at
string<date-time> | null

When the key was last used, if ever.

name
string | null

The key's name.

spend_limit
null | object

The spending limit, if one is set.

usage
null | object

Spend so far, where reported.