API 参考

星尘 AI Agent 聚合平台 · 基于 MCP 协议 · 按需付费

端点方法说明鉴权
/api/v1/pricingGET查看服务列表与价格
/api/v1/registerPOST注册账号获取 API Key
/api/v1/topupPOST充值(模拟支付)API Key
/api/v1/accountGET查询余额与使用记录API Key
/api/v1/mcpPOST调用 MCP 服务API Key
/api/v1/healthGET健康检查

快速开始

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 鉴权。

参数类型说明
servicestring服务名:deep_researchwriting_review
codestring(deep_research) A股 6 位代码,如 601118
contentstring(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