Skip to main content
PATCH
/
v1
/
workspaces
/
{workspace_id}
/
api-keys
/
{api_key_id}
Update API key
import requests

url = "https://api.auriko.ai/v1/workspaces/{workspace_id}/api-keys/{api_key_id}"

payload = {
    "name": "<string>",
    "rate_limit_rpm": 2,
    "expires_at": "2023-11-07T05:31:56Z",
    "is_active": True,
    "budget": {
        "limit_usd": 500000.005,
        "enforce": True,
        "include_byok": True
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "key_prefix": "<string>",
  "scopes": [
    "<string>"
  ],
  "is_active": true,
  "created_at": "2023-11-07T05:31:56Z",
  "rate_limit_rpm": 123,
  "expires_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z",
  "created_by_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
Change a key’s name, rate limit, expiry, or active state. Requires keys:write scope. Naturally idempotent.
Scopes are immutable after creation. Only name, rate limit, expiry, and active state can be updated.
Restrictive changes (lowering rate limit, shortening expiry, disabling) may return 202 with propagation_status: "pending" while the change takes effect.
All parameters, request/response schemas, and examples are auto-generated from the OpenAPI specification.

Authorizations

Authorization
string
header
required

API key authentication. Keys start with ak_ prefix. Example: Authorization: Bearer ak_live_xxxxxxxxxxxx

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier

api_key_id
string<uuid>
required

API key identifier

Body

application/json
name
string

Human-readable name for the key

Required string length: 1 - 255
rate_limit_rpm
integer

Per-key rate limit in requests per minute (minimum 1)

Required range: x >= 1
expires_at
string<date-time> | null

Expiration timestamp. Send null to remove expiration.

is_active
boolean

Whether the key is active

budget
object

Budget configuration for an API key.

Response

OK

Updated API key metadata with optional propagation status.

id
string<uuid>
required

Unique identifier for the API key

workspace_id
string<uuid>
required

Workspace this key belongs to

name
string
required

Human-readable name for the key

key_prefix
string
required

Key prefix for identification

profile
enum<string>
required

Key profile derived from granted scopes

Available options:
inference,
management,
mixed
scopes
string[]
required

Granted permission scopes

is_active
boolean
required

Whether the key is currently active

created_at
string<date-time>
required

When the key was created

rate_limit_rpm
integer | null

Per-key rate limit in requests per minute

expires_at
string<date-time> | null

Expiration timestamp

last_used_at
string<date-time> | null

When the key was last used

created_by_key_id
string<uuid> | null

ID of the API key that created this key

propagation_status
enum<string> | null

Status of change propagation to edge caches

Available options:
pending,
null