Tool Choice Control
Steer when and how the model invokes tools. Meridian forwards the standardtool_choiceparameter to every upstream provider, normalizing differences between Anthropic, OpenAI, and Azure dialects so your prompts behave the same everywhere.
1.The four modes
Every Meridian request accepts one of four tool_choice values. Pick the loosest mode that still gets the behavior you need — tighter modes increase latency and burn extra reasoning tokens.
- auto — default. Model decides whether to call a tool or answer directly.
- any — force a tool call, but let the model pick which one.
- tool — force a specific named tool. Useful for structured extraction.
- none — disable tool use for this turn even if tools are defined.
2.Forcing a named tool
When you need structured JSON back, define one tool whose schema matches your output shape and pin the call with tool_choice. The model will skip free-form prose and emit the tool invocation directly.
curl https://meridian.getnimbus.net/v1/messages \
-H "x-api-key: $MERIDIAN_KEY" \
-H "content-type: application/json" \
-d '{
"model": "azure/model-router",
"max_tokens": 1024,
"tools": [{
"name": "extract_invoice",
"description": "Pull line items from text",
"input_schema": { "type": "object" }
}],
"tool_choice": { "type": "tool", "name": "extract_invoice" },
"messages": [{ "role": "user", "content": "Parse this..." }]
}'3.Cost and routing notes
Forced tool calls (any or tool) skip the reasoning preamble on most upstreams, which lowers latency but reduces accuracy on ambiguous inputs. Meridian's adaptive router will not switch models mid-turn when a tool is pinned — the model you target gets the request as-is, with the 20% Meridian markup applied to billed tokens.