Skip to main content
PUT
/
policies
/
usage-limits
/
{policyUsageLimitsId}
Update Usage Limits Policy
curl --request PUT \
  --url https://api.portkey.ai/v1/policies/usage-limits/{policyUsageLimitsId} \
  --header 'Content-Type: application/json' \
  --header 'x-portkey-api-key: <api-key>' \
  --data '{
  "credit_limit": 2000,
  "alert_threshold": 1500,
  "reset_usage_for_value": "api-key-123"
}'
{}

Authorizations

x-portkey-api-key
string
header
required

Path Parameters

policyUsageLimitsId
string<uuid>
required

Usage limits policy UUID

Body

application/json
name
string

Policy name

Maximum length: 255
credit_limit
number

Maximum usage allowed

Required range: x >= 0
alert_threshold
number | null

Threshold at which to send alerts. Must be less than credit_limit.

Required range: x >= 0
periodic_reset
enum<string> | null

Reset period. Set to null to remove periodic reset.

Available options:
monthly,
weekly
reset_usage_for_value
string

Reset usage for a specific value key (e.g., API key). This will reset the usage counter for that key to 0.

Response

OK

The response is of type object.