Skip to main content
Tool calling (also called function calling) allows models to request the execution of specific functions you define. The model decides when to call a tool and with what arguments — your application executes the tool and returns the result. ARouter supports tool calling for all major providers. The interface follows the OpenAI tool calling standard.

How It Works

Tool calling follows a 3-step cycle:
  1. Inference with tools — You send a request with tool definitions. The model decides to call a tool and returns a tool_calls response.
  2. Tool execution (client-side) — Your application runs the requested function and collects the result.
  3. Inference with tool results — You send the tool result back to the model, which generates a final response.

Step 1: Inference with Tools

The model responds with a tool_calls array:

Step 2: Tool Execution (Client-Side)

Your application executes the function with the model’s arguments:

Step 3: Inference with Tool Results

Send the tool result back as a tool role message:

Full Example

Streaming Tool Calls

When streaming is enabled, tool call arguments are delivered incrementally via delta.tool_calls:

Supported Models

Use GET /v1/models to find models that support tool calling. Models with tools in their capabilities list support this feature.
Tool calling is supported by most frontier models, including:
  • openai/gpt-5.4, openai/gpt-5.4-pro
  • anthropic/claude-sonnet-4.6, anthropic/claude-opus-4.5
  • google/gemini-2.5-flash, google/gemini-2.5-pro
  • deepseek/deepseek-v3.2