Skip to main content
PATCH
Update an API key
This endpoint requires a management API key. Standard Gateway API keys are not accepted.
Use this route to rename a key, adjust scopes, set expiry, disable it, or set a spend limit with limit and limit_reset.

Authorizations

Authorization
string
header
required

Bearer token authentication

Path Parameters

id
string
required

API key identifier or hash.

Body

application/json
name
string
Minimum string length: 1
scopes
Example:

"[\"chat.completions\",\"responses\"]"

limit
number | null

Optional spend limit in USD for this key. Set null to clear.

Required range: x >= 0
limit_reset
enum<string>

Period used for the spend limit window.

Available options:
daily,
weekly,
monthly
include_byok_in_limit
boolean

Accepted for compatibility. Current Phaseo behavior always excludes BYOK from this limit field.

expires_at
string<date-time> | null
disabled
boolean
soft_blocked
boolean
limits
object
department_id
string<uuid> | null

Department this key belongs to for department rate limits and budgets. Null means the key counts only toward workspace-wide limits.

storage_locations
string[] | null

Where you keep this key, such as the hosting platform whose environment variables hold it. Optional. If one of these places reports a breach, you can find and revoke every key stored there. Known ids: railway, vercel, netlify, render, fly, heroku, cloudflare, supabase, firebase, digitalocean, replit, modal, convex, koyeb, coolify, northflank, expo, deno-deploy, aws, google-cloud, azure, hetzner, vultr, linode, ovhcloud, scaleway, kubernetes, github, gitlab, circleci, bitbucket, 1password, bitwarden, hashicorp-vault, doppler, infisical, local-machine, own-server, other.

Maximum array length: 8
Pattern: ^[a-z0-9][a-z0-9-]{0,39}$
Example:
ip_allowlist
object[]

Addresses allowed to use the key. Each entry is a labelled IPv4 or IPv6 address or CIDR range. Empty allows any address.

Maximum array length: 100

Response

Updated API key metadata

data
object
required
Last modified on October 18, 2026