Update Spending Limits
PUT /api-keys/{api_key_id}/spending-limits
Set the daily and monthly credit caps on a key. The token is unchanged.
ADMIN OR OWNER ONLY, and a key can NEVER change its own caps: a cap that the capped key could lift is not a cap.
An organization key additionally follows the rotation rules (a creator still in the organization, keys of the same
creator, scopes it holds). A full replace: null removes a window’s cap. Billable calls past a cap are refused
with 402 until the window resets.
Authorizations
Parameters
Path Parameters
Key id from GET /api-keys.
Key id from GET /api-keys.
Header Parameters
Request Body required
Replace a key’s spending caps in place. A FULL replace: resend any value you want to keep.
A cap is in credits and bounds only the BILLABLE operations that key makes: once the key’s spend for the current UTC
day (or month) would pass it, the next billable call is refused with 402. null removes that window’s cap.
Responses
200
Successful Response
object
One API key’s metadata (never the secret).
object
Sandbox or live, derived from mode (additive; a test key reads live).
CIDRs this key is restricted to. Empty = unrestricted.
Whether this key is agency-scoped. Informational — this door cannot mint one.
True for a key minted before scopes existed. An empty scope list means unrestricted, not ‘no access’.
object
Whether there are more pages
Items per page
Current page number (1-indexed)
Total number of items
422
Validation Error