tools), the model decides on its own whether the current turn needs a tool call. The tool_choice parameter gives you explicit control over this behavior: force a call, forbid calls entirely, or keep the default.
Force a tool call: "required"
Use this when your workflow must go through the tool path β for example, mandatory retrieval or a mandatory database lookup β and the model is not allowed to answer from memory:
"required" on the first turn to force the model to call search_tools, then switch back to "auto" after retrieval β see Kimi K3 API Tool Calling Best Practices.
Forbid tool calls: "none"
Use this when the request only needs a plain-text answer and you donβt want the model to trigger a tool call by mistake:
tool_calls, which also reduces latency and token consumption.
Let the model decide: "auto" (default)
Omitting tool_choice is the same as "auto": the model decides based on the context whether to call a tool. This fits regular conversations.
Force a specific tool: pass a function object
Beyond the three enum values,tool_choice also accepts a function object that forces the model to call the specified tool:
Forcing a specific tool is currently incompatible with thinking: with thinking enabled, the request returns a 400 error (
tool_choice 'specified' is incompatible with thinking enabled).Full request example
The following example declares a weather tool and usestool_choice: "required" to force the model to call it:
- curl
- python
Notes
tool_choiceis a request-level parameter: it takes effect independently for each request and only constrains tool selection for that generation;- Setting
tool_choice(or not setting it) does not invalidate the prefix cache, so feel free to adjust it on a per-request basis.
Related reading
- Kimi K3 API Tool Calling Best Practices: combined practices for dynamic loading, tool_choice, and thinking effort
- Dynamically Loaded Tools: inject tool definitions on demand when you have a large tool inventory, reducing token usage and improving tool-selection accuracy
- Use Kimi API for Tool Calls: the complete tool-calling workflow and examples
- Model Parameter Reference: per-model support for the
tool_choiceparameter