POST /v1/chat/completions
Tools are declared with a nested function object. The model returns tool_calls inside the assistant message.
Define a tool
Full loop
Streaming
Tool-call arguments arrive across multiple chunks. Accumulatedelta.tool_calls[i].function.arguments strings until finish_reason: "tool_calls". See streaming.
Forcing a tool
"none" disables tools; "auto" is the default.
Parallel tool calls
The model can return multipletool_calls in one response. Execute them in parallel and append each result with a matching tool_call_id.