v1/chat/completions endpoint supports function calling through the tools and tool_choice parameters. For reasoning models, you can also set reasoning_effort to control how much internal reasoning the model performs before responding.
The Jinja chat template of the tokenizer must accept tools for function calling to work.
Defining tools
Provide tool definitions so the model knows which functions it can call:Tool choice
Usetool_choice to control whether and which tool the model should call:
auto(default): The model decides whether to call a tool.none: The model will not call any tools.required: The model must call one or more tools.- Specific function: Pass
{"type": "function", "function": {"name": "get_current_weather"}}to force a particular function.
Reasoning effort
For supported reasoning models, setreasoning_effort to balance quality and latency:
none, minimal, low, medium, high, and xhigh.
Handling tool calls
We attempt to parse tool calls from model responses and return them in the standardtool_calls field on the assistant message. When parsing succeeds, you can use the response directly:

