Skip to content

用户接口

用户接口前缀为 /api/user,需要登录 JWT:

text
Authorization: Bearer <jwt>

当前用户与目录

方法路径参数请求体返回值
GET/api/user/me当前用户信息、余额、分组等。
GET/api/user/catalog当前用户可用渠道、模型、价格、视频计费配置。
GET/api/user/stats当前用户仪表盘统计。
GET/api/user/logsQuery: 分页、模型、时间范围等。当前用户用量日志或分页对象。

邀请与签到

方法路径参数请求体返回值
GET/api/user/referral当前用户邀请码、邀请统计、返佣配置。
GET/api/user/check-in/status签到配置和今日签到状态。
GET/api/user/check-in/recordsQuery: 分页。签到记录。
POST/api/user/check-in签到奖励结果。

支付与订单

方法路径参数请求体返回值
GET/api/user/payment/config支付开关、币种、汇率、最小充值金额、可用支付方式。
GET/api/user/payment/ordersQuery: 分页、时间范围。充值订单列表或分页对象。
POST/api/user/payment/ordersamountmethod新建订单,包含 payment_url
GET/api/user/payment/orders/:order_noPath: order_no充值订单详情。

创建订单请求:

json
{
  "amount": "10",
  "method": "alipay"
}

订单返回:

json
{
  "order_no": "20260101000000xxxx",
  "amount": "10",
  "rmb_amount": "72.00",
  "method": "alipay",
  "status": "pending",
  "payment_url": "https://..."
}

Passkey 管理

方法路径参数请求体返回值
GET/api/user/passkeys当前用户 Passkey 列表。
POST/api/user/passkeys/register/options注册选项,如设备名。WebAuthn 注册挑战。
POST/api/user/passkeys/registerWebAuthn 注册响应。新建 Passkey 或成功响应。
DELETE/api/user/passkeys/:idPath: id删除成功响应。

修改密码与 OIDC

方法路径参数请求体返回值
GET/api/user/password/method当前账号可用的修改密码方式。
POST/api/user/password/email-codeemailcaptcha_token发送成功响应。
POST/api/user/password/change当前密码或邮箱验证码、新密码。修改成功响应。
POST/api/user/oidc/bind-url{ "auth_url": "https://..." }

API Key

方法路径参数请求体返回值
GET/api/user/api-keys当前用户 API Key 列表。
POST/api/user/api-keys名称、允许模型、允许用户渠道、IP 限制、额度等。新建 API Key,包含明文 key。
PUT/api/user/api-keys/:idPath: idAPI Key 配置字段。更新后的 API Key。
POST/api/user/api-keys/:id/rotatePath: id新明文 API Key。
POST/api/user/api-keys/:id/reset-usagePath: id重置成功响应。
DELETE/api/user/api-keys/:idPath: id删除成功响应。
POST/api/user/api-key/rotate兼容旧接口,可通过 body 或上下文定位 key。可选 API Key 标识。新明文 API Key。

基于 MIT 协议发布(社区版)