请求头

请求头必填说明
Authorization✓Bearer YOUR_ACCESS_TOKEN,账号访问令牌(控制台登录态,非 sk- API Key)
Content-Type✓application/json

接口:POST /api/token/ 创建一个新的 API Key。Key 由服务端生成,不在响应中返回——需在控制台一次性复制保存。

请求体

字段必填类型说明
name✓stringToken 名称(≤ 50 字符)
expired_time✓integer过期时间 Unix 秒;-1 表示永不过期
remain_quota✓integer初始额度(quota);无限额度时配合 unlimited_quota: true
unlimited_quota✓boolean是否不限额度
model_limits_enabledboolean是否启用模型白名单
model_limitsstring模型白名单(逗号分隔,空串不限制)
allow_ipsstringnull
groupstring分组,取自 GET /api/user/self/groups 的键;空串表示不指定
cross_group_retryboolean是否跨分组重试(仅 auto 分组有效)
curl -X POST https://top.qingyuntop.ai/api/token/ \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-token","expired_time":-1,"remain_quota":-1,"unlimited_quota":true,"model_limits_enabled":false,"group":""}'

Response

{
  "success": true,
  "message": ""
}