Skip to main content
PATCH
Python

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.

Path Parameters

key_id
integer<int64>
required

The key's id, as the listing reports it.

Body

application/json

The body of PATCH /v1/account/keys/{key_id}; an absent field stays.

default_routing_strategy
enum<string> | null

A new default routing strategy, or null to follow the key's workspace. An unknown name draws a 400.

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

A replacement label, between 1 and 255 characters. An explicit null draws a 400.

is_enabled
boolean

Whether the key works at all. A disabled key draws a 401 disabled_api_key. Enabling a key whose workspace is archived draws a 400.

credit_limit
number<double> | null

A replacement spending limit in credits, or null to clear it.

credit_limit_period
enum<string>

A new window for credit_limit. An explicit null or an unknown name draws a 400.

Available options:
day,
week,
month,
all
expires_at
string | null

A later expiry, or null to clear it. An organization that caps key lifetime shortens a later or cleared expiry to its cap.

workspace_id
integer<int64> | null

Move the key to this workspace, or null to move it to the Default workspace. The key keeps its secret, limit and spend. Another account's or an unknown workspace draws a 400, and so does an archived one for an enabled key.

Response

The key as it stands after the change, without its secret.

One API key of the account, without its secret.

id
integer<int64>
required

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

name
string
required

The label the key carries.

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 for one that never expires.

is_enabled
boolean
required

Whether the key works at all.

credit_limit
number<double> | null
required

The key's own spending limit in credits, or null for none.

credit_limit_period
enum<string>
required

The window credit_limit covers; all on a key that never resets.

Available options:
day,
week,
month,
all
default_routing_strategy
enum<string> | null
required

The key's own default routing strategy, or null when it follows its workspace.

Available options:
reliability,
balanced,
latency,
throughput,
cache
workspace_id
integer<int64> | null
required

The workspace the key is in, or null for the Default workspace.