请求头
| 请求头 | 必填 | 说明 |
|---|---|---|
Authorization | ✓ | Bearer YOUR_ACCESS_TOKEN,账号访问令牌(控制台登录态,非 sk- API Key) |
Content-Type | ✓ | application/json |
接口:POST /api/token/ 创建一个新的 API Key。Key 由服务端生成,不在响应中返回——需在控制台一次性复制保存。
请求体
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
name | ✓ | string | Token 名称(≤ 50 字符) |
expired_time | ✓ | integer | 过期时间 Unix 秒;-1 表示永不过期 |
remain_quota | ✓ | integer | 初始额度(quota);无限额度时配合 unlimited_quota: true |
unlimited_quota | ✓ | boolean | 是否不限额度 |
model_limits_enabled | boolean | 是否启用模型白名单 | |
model_limits | string | 模型白名单(逗号分隔,空串不限制) | |
allow_ips | string | null | |
group | string | 分组,取自 GET /api/user/self/groups 的键;空串表示不指定 | |
cross_group_retry | boolean | 是否跨分组重试(仅 auto 分组有效) |
curl -X POST https://top.qingyuntop.ai/dashboard//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": ""
}