Skip to main content
Changes an API key’s name, status, expiry, IP restriction or routing groups. Only the fields you send change; null is rejected — send [] or "" to clear. An expired key can be enabled only together with a future expires_at; a key whose owner has been deleted cannot be enabled; the key used for this request cannot disable itself. Routing groups must be public or the key owner’s own.
Permission required: service_account:update (your own keys only) or service_account:update (all keys)

Path Parameters

string
required
Identifier of the API key

Request Body

array
Replace the IP / CIDR restriction. [] removes it.
string
Fallback model-routing group. "" clears it.
integer
New expiry, Unix seconds. 0 = never expires.
string
Model-routing group. "" clears it.
string
New display name. Usage records are kept under the key’s name at the time of each request, so renaming splits the key’s history.
string
Enable or disable the key. An expired key can be enabled only together with a future expires_at. One of: enabled, disabled.

Response

object

Errors

Errors answer with success: false, a message and an error_code. See Error Codes for every code.