Inference Router Tool Calling
Declare a Function Tool
Declare function tools as you would for the OpenAI Chat Completions or Anthropic Messages API. The router passes them to the model. When the model calls one, the response has finish_reason: "tool_calls" and the calls in message.tool_calls.
Run the function yourself, then send its result back in a message with role: "tool" and the tool_call_id of the call. The model then answers.
Whether a model honors tool_choice is up to the model’s vendor.
Combine With Web Tools
A request can declare function tools and web tools together. The router runs a turn that calls only web tools and continues. A turn that calls one of your function tools comes back to you with the tool calls, and the router does not run web tools in that turn.
When the model calls a function tool and a web tool in the same turn, tool_calls lists both calls. The web call is named you_web_search or you_web_extract, but the router does not run it in that turn or resume it on the next request. To continue that turn, handle the web call yourself and send a role: "tool" result for every returned tool_call_id.
When a request declares a web tool, parallel_tool_calls defaults to true unless you set it.