Server Tools は、推論中に ARouter がモデルに代わって実行する機能です。ユーザー定義の関数呼び出し(コードが関数を実行する)とは異なり、Server Tools は ARouter が完全に処理します——モデルがいつ呼び出すかを決定し、ARouter がそれを実行し、結果は自動的に会話に注入されます。
Server Tools は現在 ベータ版 です。インターフェースは安定していますが、追加のツールが追加中です。
| ツール ID | 説明 | 価格 |
|---|
web_search | ウェブを検索し、引用付きの構造化された結果を返す | 検索クエリごと |
datetime | 任意のタイムゾーンの現在の日付と時刻を返す | 無料 |
| Server Tools | Plugins | ユーザー定義ツール |
|---|
| 誰が実行するか? | ARouter | ARouter | あなたのアプリ |
| モデルが呼び出しを制御? | はい | いいえ(毎リクエストに適用) | はい |
| 構造化された引用? | はい | はい(ウェブのみ) | N/A |
| ストリーミングで利用可能? | はい | はい | はい |
クイックスタート
{
"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}
}
}
次のステップ