Tool calling
Let a model call your functions using the OpenAI tools shape, translated for Anthropic models.
Send tools in the OpenAI function shape on POST /chat/completions and the model can answer with tool_calls instead of text. You run the function, append its result as a role: "tool" message carrying the tool_call_id, and call again. The shape is the same on every model: for Anthropic models the gateway turns the tools into Anthropic's format, and the tool_use blocks that come back into tool_calls with finish_reason: "tool_calls".
curl https://rapidrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $RAPIDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [{ "role": "user", "content": "What is the weather in Indore?" }],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Current weather for a city",
"parameters": {
"type": "object",
"properties": { "city": { "type": "string" } },
"required": ["city"]
}
}
}]
}'
# -> choices[0].finish_reason: "tool_calls"
# choices[0].message.tool_calls: [{ "id": "toolu_...", "type": "function",
# "function": { "name": "get_weather", "arguments": "{\"city\":\"Indore\"}" } }]tool_choice takes "auto" (the default), "none", "required", or { "type": "function", "function": { "name": "get_weather" } } to force one function. With stream: true the calls arrive as tool_calls deltas in the standard chunk shape, Anthropic models included.
Which models. capabilities.tools in GET /models is true for models that take tools; filter on it before you send them. Where a model has several routes, "provider": { "require_parameters": true } keeps the request on routes known to honour tools (routing).
Send tool calls back unchanged. Gemini 3 attaches extra_content.google.thought_signature to a tool call and checks it on the next turn. If your client drops it, as some older SDKs do, the gateway fills in Google's documented placeholder so the call still succeeds, at the cost of that step's earlier reasoning.
The other request formats take tools in their own shape: /v1/messages with Anthropic's input_schema, and /v1/responses with flat function tools and function_call output items.