메인 콘텐츠로 건너뛰기
PATCH
/
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": ["openai/gpt-5.4", "anthropic/claude-sonnet-4.6", "google/gemini-2.5-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": ["openai/gpt-5.4", "anthropic/claude-sonnet-4.6", "google/gemini-2.5-flash"]
  }'
요청 본문의 모든 필드는 선택적입니다 — 변경하려는 필드만 포함하세요.

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}'
비활성화된 key는 즉시 요청 수락을 중지합니다. disabled: false로 설정하면 다시 활성화됩니다.

지출 한도 업데이트

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"
  }'
limitnull로 설정하면 지출 상한이 제거됩니다. limit_reset 필드는 카운터가 재설정되는 시기를 제어합니다: daily(UTC 자정), weekly(월요일 UTC 자정), 또는 monthly(매월 1일 UTC 자정). null로 설정하면 평생 상한이 됩니다.