Update an API Key
Modify a Regular API Key's name, limit, and model policy.
Request Parameters
| Field | Required | Type | Description |
|---|---|---|---|
name | No | string | New name |
limit | No | number | New limit; to switch to no limit, also submit limit_reset: "never" |
limit_reset | No | string | New reset period: never, daily, weekly, monthly |
model_allowlist | No | string[] | Replace the allowlist; empty array = clear |
model_blocklist | No | string[] | Replace the blocklist; empty array = clear |
At least one field must be provided. disabled cannot be modified with PATCH; enabling/disabling must use the toggle endpoint.
- For a key that already has a limit policy, you can modify only
limitorlimit_reset; unprovided fields remain unchanged. - When switching to no limit, submit
{"limit": 0, "limit_reset": "never"}; otherwise400 invalid_parametermay be returned. - The
disabledfield cannot be modified with PATCH; use the toggle endpoint to enable/disable.
Response Example
{
"id": "key_01j...",
"updated": true
}
For general request conventions, data structures, and error codes, see the Key Management API overview.