Skip to content

Unify API

给你的 agent 一个 MCP 服务器。

在 agent 中添加一个 MCP 服务器 URL,即可在工具内浏览模型、管理 key、查看额度。

POST /api/v1/mcp
{removed:   "mcpServers": {}added:   "mcpServers": {added:     "anyrouter": {added:       "url": "https://anyrouter.dev/api/v1/mcp"added:     }added:   }}
完整 MCP 设置

返回了什么

上面的 cURL 标签页,于 2026-10-31 在生产环境用 Go 套餐 key 运行。只保留显示的字段,过长的值用 "…" 截断。

captured from prod
HTTP 200
mcp-protocol-version: 2026-07-28

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      "list_models",
      "recommend_model",
      "list_okf_concepts",
      "get_okf_concept",
      "publish_artifact",
      "list_artifacts",
      "get_artifact",
      "delete_artifact",
      "set_artifact_visibility",
      "get_system_status"
    ]
  }
}
mcp-protocol-version
服务器使用的 MCP 协议版本。

已支持

  • 首次调用工具时 OAuth 登录
  • 任何 key 都可用模型工具;OAuth 登录后可用账户工具(get_credits、create_key)

Decisions 模型

不是聊天。发送一个情境和带固定选项的问题,返回每个选项的概率。Decisions 在 Go 及以上套餐免费,Free 套餐可试用 5 次请求。

POST /api/v1/decisions
curl https://anyrouter.dev/api/v1/decisions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "hal-x/thx-01", "state": "My card was charged twice",
    "questions": {"team": {"type": "choice", "criteria": {"billing": "Payments", "tech": "API problems"}}}}'

# {"answers": {"team": {"type": "choice", "choice": "billing", "probabilities": {"billing": 0.97, "tech": 0.03}}}, "model": "hal-x/thx-01", "status": "completed"}

相关文档与用例

下一步