Server Tools are capabilities that ARouter executes on behalf of models during inference. Unlike user-defined function calling (where your code runs the function), Server Tools are handled entirely by ARouter — the model decides when to invoke them, ARouter executes them, and the results are injected back into the conversation automatically.
Server Tools are currently in beta. The interface is stable but additional tools are being added.
| Tool ID | Description | Pricing |
|---|
web_search | Search the web and return structured results with citations | Per search query |
datetime | Return the current date and time in any timezone | Free |
| Server Tools | Plugins | User-Defined Tools |
|---|
| Who executes? | ARouter | ARouter | Your application |
| Model controls invocation? | Yes | No (applied every request) | Yes |
| Structured citations? | Yes | Yes (web only) | N/A |
| Available in streaming? | Yes | Yes | Yes |
| Configuration | Per-request in tools array | Per-request in plugins array | Per-request in tools array |
Use Server Tools when you want the model to decide whether and when to search, rather than forcing a search on every request.
The entire tool execution cycle happens server-side. Your application receives the final response with results already incorporated.
Quick Start
Add Server Tools to any chat completion request via the tools array using the arouter: namespace:
{
"model": "openai/gpt-5.4",
"messages": [
{"role": "user", "content": "What are the top AI news stories today?"}
],
"tools": [
{"type": "arouter", "arouter": {"id": "web_search"}}
]
}
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.arouter.ai/v1",
apiKey: "lr_live_xxxx",
});
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);
from openai import OpenAI
client = OpenAI(
base_url="https://api.arouter.ai/v1",
api_key="lr_live_xxxx",
)
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"}}
],
extra_body={},
)
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": "What are the top AI news stories today?"}
],
"tools": [
{"type": "arouter", "arouter": {"id": "web_search"}}
]
}'
You can enable multiple Server Tools in a single request. The model will choose which to invoke based on the user’s query:
{
"model": "openai/gpt-5.4",
"messages": [
{"role": "user", "content": "What important AI events happened this week?"}
],
"tools": [
{"type": "arouter", "arouter": {"id": "web_search"}},
{"type": "arouter", "arouter": {"id": "datetime"}}
]
}
Server Tools can coexist with your own function definitions:
{
"model": "openai/gpt-5.4",
"messages": [{"role": "user", "content": "..."}],
"tools": [
{"type": "arouter", "arouter": {"id": "web_search"}},
{
"type": "function",
"function": {
"name": "get_user_data",
"description": "Get data from our internal database",
"parameters": {...}
}
}
]
}
ARouter handles the arouter type tools; your application handles the function type tools.
Usage Tracking
Server Tool usage is tracked in the usage field:
{
"usage": {
"prompt_tokens": 450,
"completion_tokens": 210,
"total_tokens": 660,
"cost": 0.00234,
"server_tool_calls": {
"web_search": 2
}
}
}
Next Steps