Skip to main content
Tools use the OpenAI format for every provider. For Claude, RouteHub translates tool definitions, calls and results to Anthropic’s format and back, parallel calls included.

Define a tool

Run a tool loop

Append the assistant message, run each requested tool, append the results as tool messages, and call the model again:
tool_calls is None when the model answers in text.
Append message.model_dump(exclude_none=True) rather than building the assistant message by hand. It keeps Claude’s thinking_blocks, which Anthropic requires back on multi-turn tool use with thinking, and RouteHub strips them for other providers.

Control tool choice

tool_choice and parallel_tool_calls work as in the OpenAI API:
Claude 5.1 and later (Opus 5.5, Sonnet 5.5, Fable 5.1) reject a forced tool_choice, either "required" or a named tool. RouteHub raises UnsupportedParamsError before sending the request, or sends "auto" when you pass drop_params=True.