管理接口令牌管理
创建令牌
POST
创建新的 API 令牌。
header
AuthorizationBearer <API key>使用 Authorization Bearer API Key 进行鉴权。
application/json- body
id?integer令牌 ID,更新令牌时必填。
name*stringAPI 令牌名称。
remain_quota?integer令牌剩余额度,支持时可用 -1 表示不限额。
expired_time?integer过期时间,Unix 秒级时间戳;支持时可用 -1 表示不过期。
unlimited_quota?boolean是否启用不限额。
model_limits_enabled?boolean是否启用模型调用限制。
model_limits?string允许调用的模型范围。
allow_ips?string允许访问的 IP 白名单。
创建令牌响应。
application/json- response
success?boolean请求是否成功。
message?string接口返回消息。
data?API 令牌详情。
curl -X POST 'https://goldflow.cc/api/token/' \ -H 'Content-Type: application/json' \ -d '{ "name": "default", "remain_quota": 500000, "expired_time": -1}'Example Response200
{ "success": true, "message": "string", "data": { "id": 0, "name": "string", "key": "string", "status": 0, "remain_quota": 0, "used_quota": 0, "expired_time": 0, "created_time": 0 }}