Skip to main content
PATCH
https://api.arouter.ai
/
api
/
v1
/
keys
/
{hash}
curl -X PATCH https://api.arouter.ai/api/v1/keys/KEY_HASH \
  -H "Authorization: Bearer lr_mgmt_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "production-backend-v2",
    "limit": 200,
    "limit_reset": "monthly",
    "allowed_providers": ["openai", "anthropic", "google"],
    "allowed_models": ["gpt-4o", "claude-sonnet-4-20250514", "gemini-2.0-flash"]
  }'
curl -X PATCH https://api.arouter.ai/api/v1/keys/KEY_HASH \
  -H "Authorization: Bearer lr_mgmt_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "production-backend-v2",
    "limit": 200,
    "limit_reset": "monthly",
    "allowed_providers": ["openai", "anthropic", "google"],
    "allowed_models": ["gpt-4o", "claude-sonnet-4-20250514", "gemini-2.0-flash"]
  }'
All fields in the request body are optional — only include the fields you want to change.

Disable / Enable a Key

curl -X PATCH https://api.arouter.ai/api/v1/keys/KEY_HASH \
  -H "Authorization: Bearer lr_mgmt_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"disabled": true}'
Disabled keys immediately stop accepting requests. Set disabled: false to re-enable.

Update Spending Limits

curl -X PATCH https://api.arouter.ai/api/v1/keys/KEY_HASH \
  -H "Authorization: Bearer lr_mgmt_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "limit": 500,
    "limit_reset": "monthly"
  }'
Set limit to null to remove the spending cap. The limit_reset field controls when the counter resets: daily (midnight UTC), weekly (Monday midnight UTC), or monthly (1st of month midnight UTC). Set to null for a lifetime cap.