更新 API Key

PUT /api/v1/gateway/keys/{key_id}

请求参数

参数 位置 类型 必填 说明
key_id path string

请求体

字段 类型 必填 说明
name string | null Name
models_allowed array | null Models Allowed
allowed_ips array | null Allowed Ips
rpm_limit integer | null Rpm Limit
tpm_limit integer | null Tpm Limit
spending_limit_usd number | string | null Spending Limit Usd

请求示例

curl -X PUT https://api.openbili.com/api/v1/gateway/keys/KEY_ID \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

响应

字段 类型 必填 说明
id string Id
org_id string Org Id
team_id string | null Team Id
name string Name
key string | null Full key, only returned at creation
key_prefix string Key Prefix
models_allowed array Models Allowed
rpm_limit integer Rpm Limit
tpm_limit integer Tpm Limit
is_sandbox boolean Is Sandbox
allowed_ips array | null Allowed Ips
spending_limit_usd string | null Spending Limit Usd
expires_at string | null Expires At
rotate_grace_until string | null Rotate Grace Until
status string Status
created_at string | string Created At