🚀 快速开始
所有 API 需在请求头添加 Authorization: Bearer <你的token>
通过 POST /api/auth/login 获取 token,注册即送体验金。

🔐 认证

POST /api/auth/register POST
注册新用户,自动返回 token
POST /api/auth/register
{
  "username": "demo_user",
  "password": "pass123456"
}
→
{
  "token": "eyJhbGci...",
  "user": {"id": 1, "username": "demo_user", ...}
}
POST /api/auth/login POST
登录获取 token
POST /api/auth/login
{"username": "demo", "password": "demo123"}
→ {"token": "eyJ...", "user": {...}}

🤖 超算工坊

GET /api/superbuddy/conversations GET
获取对话列表
→ {"conversations": [{"id":"...", "title":"...", "message_count":3}, ...]}
POST /api/superbuddy/conversations POST
创建新对话(指定场景)
{"title": "🔬 超级计算", "scenario": "science"}
→ {"id": "abc123", "title": "🔬 超级计算", ...}
POST /api/superbuddy/chat POST
发送消息(每条消耗10积分)
{
  "conv_id": "abc123",
  "content": "帮我设计一个分子模拟方案",
  "model": "auto"
}
→ {"assistant_message": {"role":"assistant", "content":"...", "timestamp":"..."}}
POST /api/superbuddy/search?q=关键词 GET
搜索对话和消息内容
→ {"results": [...], "total": 3}

💎 积分系统

GET /api/superbuddy/points GET
查看当前积分
→ {"points": 1000, "credit_balance": 10.00}
POST /api/superbuddy/points/buy POST
用余额购买积分(1元=100积分)
{"amount": 10} → {"success": true, "points": 1000}

📊 数据

GET /api/user/stats GET
个人数据看板统计
GET /api/leaderboard GET
算力贡献排行榜(Top 20)

📢 公告 & 工单

GET /api/announcements GET
获取平台公告列表(无需登录)
POST /api/tickets POST
提交反馈/工单
{"subject": "BUG反馈", "content": "...", "type": "bug"}

📤 分享与导出

POST /api/superbuddy/share POST
生成对话分享链接
{"conv_id": "abc123"} → {"share_url": "/share/xxxx"}
POST /api/superbuddy/conversations/{id}/export POST
导出对话JSON文件

🎁 邀请奖励

GET /api/referral/info GET
获取推荐链接和奖励信息
POST /api/referral/claim POST
领取推荐奖励(双方各¥5)

💰 充值 & 提现

POST /api/recharge/request POST
申请充值(最低¥100)
POST /api/withdraw/request POST
申请提现(最低¥100,支持USDT/银行卡)

🤖 LLM 网关(OpenAI 兼容)

⚠️ 使用前须知
LLM 网关需要管理员在「管理后台 → 🤖 LLM管理」先配置 API 供应商 Key,否则返回 400。
所有请求需 Authorization: Bearer <用户Token>,按 token 量扣费,余额不足返回 402。
GET /v1/models GET
获取可用模型列表,含 auto 智能路由选项
GET /v1/models
→ {"object":"list","data":[{"id":"auto"},{"id":"deepseek-chat","pricing":{"input":0.30,"output":1.20}}]}
POST /v1/chat/completions POST
OpenAI 兼容对话补全(需 JWT 鉴权 + 余额充足)
{
  "model": "auto",
  "messages": [{"role":"user","content":"用Python写快速排序"}],
  "stream": false
}
→ {"choices":[{"message":{"content":"..."}}], "usage":{...}, "_cost":0.0003}
model: "auto" 自动分析任务类型,匹配最优供应商
• 按 token 量扣费(¥/M tokens),响应中 _cost 为本次费用
• 余额不足返回 HTTP 402
POST /v1/images/generations POST
图片生成(需指定模型,暂不支持 AUTO)
POST /v1/audio/transcriptions POST
语音转文字(需指定模型)
POST /v1/embeddings POST
文本嵌入向量
GET /v1/dashboard/billing GET
查看账户余额:{"credit_balance": 100, "currency": "CNY"}
⚡ 速率限制
注册:30次/分钟 · 登录:60次/分钟 · 其他API:60次/分钟
超出限制返回 HTTP 429,请等待1分钟后重试。
💡 需要更多帮助?
提交工单:POST /api/tickets · 管理后台:管理员登录后访问管理面板