Skip to main content
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.

Available Server Tools

Tool IDDescriptionPricing
web_searchSearch the web and return structured results with citationsPer search query
datetimeReturn the current date and time in any timezoneFree

Server Tools vs Plugins vs User-Defined Tools

Server ToolsPluginsUser-Defined Tools
Who executes?ARouterARouterYour application
Model controls invocation?YesNo (applied every request)Yes
Structured citations?YesYes (web only)N/A
Available in streaming?YesYesYes
ConfigurationPer-request in tools arrayPer-request in plugins arrayPer-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.

How Server Tools Work

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);

Combining Multiple Server Tools

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"}}
  ]
}

Combining with User-Defined Tools

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