API Keys

Update Spending Limits

Changed on

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.

put/api-keys/{api_key_id}/spending-limits

Request

  • Base URL: https://be.graph8.com/api/v1
  • URL: https://be.graph8.com/api/v1/api-keys/{api_key_id}/spending-limits
  • Auth: HTTP bearer

Path parameters

api_key_idstring required

Key id from GET /api-keys.

Headers

X-Target-Org-Idstring nullable
Authorizationstring nullable

Request body

daily_credit_capinteger nullable

Daily cap in credits, resetting 00:00 UTC; null = no daily cap.

monthly_credit_capinteger nullable

Monthly cap in credits, resetting on the 1st; null = no monthly cap.

spend_alert_threshold_pctinteger nullable

Alert the key owner at this percent of a cap. Defaults to 80 when a cap is set.

Response

Successful Response

Changes