Skip to main content

Update an API Key

Modify a Regular API Key's name, limit, and model policy.

Request Parameters

FieldRequiredTypeDescription
nameNostringNew name
limitNonumberNew limit; to switch to no limit, also submit limit_reset: "never"
limit_resetNostringNew reset period: never, daily, weekly, monthly
model_allowlistNostring[]Replace the allowlist; empty array = clear
model_blocklistNostring[]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.

Partial Update Semantics
  • For a key that already has a limit policy, you can modify only limit or limit_reset; unprovided fields remain unchanged.
  • When switching to no limit, submit {"limit": 0, "limit_reset": "never"}; otherwise 400 invalid_parameter may be returned.
  • The disabled field cannot be modified with PATCH; use the toggle endpoint to enable/disable.

Response Example

{
"id": "key_01j...",
"updated": true
}
Related Endpoints

For general request conventions, data structures, and error codes, see the Key Management API overview.

Online Service