Server Tools 目前处于 beta 阶段。接口已稳定,但仍在持续添加更多工具。
可用的 Server Tools
Server Tools vs Plugins vs 用户自定义工具
快速开始
- TypeScript
- Python
- cURL
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
为模型提供实时能力,如网页搜索和日期时间。Server Tools 由 ARouter 代表模型执行,无需任何客户端逻辑。
| 工具 ID | 描述 | 定价 |
|---|---|---|
web_search | 搜索网页并返回带引用的结构化结果 | 按搜索次数计费 |
datetime | 返回任意时区的当前日期和时间 | 免费 |
| Server Tools | Plugins | 用户自定义工具 | |
|---|---|---|---|
| 谁来执行? | ARouter | ARouter | 你的应用 |
| 模型控制调用? | 是 | 否(每次请求都应用) | 是 |
| 结构化引用? | 是 | 是(仅网页) | 不适用 |
| 支持流式传输? | 是 | 是 | 是 |
{
"model": "openai/gpt-5.4",
"messages": [{"role": "user", "content": "What are the top AI news stories today?"}],
"tools": [{"type": "arouter", "arouter": {"id": "web_search"}}]
}
const response = await client.chat.completions.create({
model: "openai/gpt-5.4",
messages: [{ role: "user", content: "What are the top AI news stories today?" }],
tools: [{ type: "arouter", arouter: { id: "web_search" } } as any],
});
console.log(response.choices[0].message.content);
response = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "What are the top AI news stories today?"}],
tools=[{"type": "arouter", "arouter": {"id": "web_search"}}],
)
print(response.choices[0].message.content)
curl https://api.arouter.ai/v1/chat/completions \
-H "Authorization: Bearer lr_live_xxxx" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-5.4", "messages": [{"role": "user", "content": "Top AI news today?"}], "tools": [{"type": "arouter", "arouter": {"id": "web_search"}}]}'
{
"usage": {
"prompt_tokens": 450, "completion_tokens": 210, "total_tokens": 660, "cost": 0.00234,
"server_tool_calls": {"web_search": 2}
}
}