创建 API Key

POST /api/v1/gateway/keys

请求体

字段 类型 必填 说明
name string Name
team_id string | null Team Id
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 number | string | null Total spending cap in USD. null = unlimited.
expires_at string | null Expires At

请求示例

curl -X POST https://api.openbili.com/api/v1/gateway/keys \
  -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