API 参考
星尘 AI Agent 聚合平台 · 基于 MCP 协议 · 按需付费
| 端点 | 方法 | 说明 | 鉴权 |
/api/v1/pricing | GET | 查看服务列表与价格 | 无 |
/api/v1/register | POST | 注册账号获取 API Key | 无 |
/api/v1/topup | POST | 充值(模拟支付) | API Key |
/api/v1/account | GET | 查询余额与使用记录 | API Key |
/api/v1/mcp | POST | 调用 MCP 服务 | API Key |
/api/v1/health | GET | 健康检查 | 无 |
快速开始
1. 注册
获取你的 API Key:
curl -X POST https://agent.token-star.cn/api/v1/register \
-H 'Content-Type: application/json' \
-d '{"username": "你的用户名"}'
返回包含 apiKey,例如 sk-xxxxxxxxxxxxxxxxxxxxxxxx。
2. 查看服务
curl -s https://agent.token-star.cn/api/v1/pricing | python3 -m json.tool
3. 调用服务
curl -s -X POST https://agent.token-star.cn/api/v1/mcp \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{"service": "deep_research", "code": "601118"}'
写作质量审核:
curl -s -X POST https://agent.token-star.cn/api/v1/mcp \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{"service": "writing_review", "content": "需要审核的文章内容..."}'
API 参考
GET 服务定价
/api/v1/pricing
返回所有可用服务及其价格。无需鉴权。
POST 注册
/api/v1/register
{ "username": "your_name" }
{ "id": "uuid", "username": "your_name", "apiKey": "sk-..." }
POST MCP 调用
/api/v1/mcp
调用已注册的 MCP 服务。需 Bearer Token 鉴权。
| 参数 | 类型 | 说明 |
service | string | 服务名:deep_research 或 writing_review |
code | string | (deep_research) A股 6 位代码,如 601118 |
content | string | (writing_review) 需要审核的文章正文 |
POST 充值
/api/v1/topup
{ "amount": 1000, "payment": "wechat" }
{ "orderId": "...", "amount": 10, "balance": 10, "paymentUrl": "weixin://pay/..." }
注意 当前为模拟支付,实际支付集成开发中。
GET 账户与余额
/api/v1/account
返回当前用户的余额与最近使用记录。
支持与服务
基础地址:https://agent.token-star.cn
计费方式:按次计费,每次调用扣取对应服务价格,有月度订阅则不扣次费
数据格式:所有请求与响应均为 JSON