Tool Choice
Tool choice is an API parameter on modern tool-calling models that controls whether and how the model selects a tool. Common values are `auto` (the model decides whether to call a tool), `none` (all tools disabled for this turn), `required` (the model must call some tool), and a specific named tool (the model must call exactly that tool). Tool choice matters in production because it prevents the common failure where the model refuses to call a tool when one is required, and it lets you enforce structured outputs by constraining the response to a single formatting tool that the model is forced to use.
Example
A classification endpoint defines a single tool `record_classification(label: string, confidence: number)` and calls the model with `tool_choice: { type: "tool", name: "record_classification" }`. The model cannot free-text its way out — every response arrives as arguments to that tool, giving the caller a guaranteed schema. In contrast, a chat endpoint with the same tools available uses `tool_choice: "auto"`, letting the model answer conversationally when no tool is needed.
Put this into practice
Build polished, copy-ready prompts in under 60 seconds with SurePrompts.
Try SurePrompts