Skip to main content
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. Accumulate delta.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 multiple tool_calls in one response. Execute them in parallel and append each result with a matching tool_call_id.
Last modified on April 21, 2026