Skip to main content
Chat Completions API uses the OpenAI chat tool format: define tools, receive tool_calls, and return tool results as role: tool messages. Use this when you need tool calling but want to keep an existing chat-based client or agent stack.

Request Shape

Assistant Tool Call

When the model decides to call a tool, the assistant message includes tool_calls.

Return Tool Results

Send tool results back as a role: tool message with the matching tool_call_id.
If you are continuing a larger workflow, keep any earlier assistant tool call and related context in the replayed message history. Some reasoning-capable models also return reasoning_details alongside tool calls. If you want continuity across turns, return that reasoning payload unchanged with the assistant message in the follow-up request. See Chat Completions Reasoning.

Streaming Behavior

When streaming is enabled, tool arguments arrive incrementally in delta.tool_calls[].function.arguments.

Caveats

  • the chat wire shape uses tool_calls, not function_call items
  • the follow-up tool result must be a role: tool message, not a function_call_output item
  • parallel_tool_calls is a request-level flag when you need to constrain parallel tool execution behavior

Common mistakes

  • sending tool results back in Responses format instead of chat message format
  • assuming the assistant will always produce final text in the same turn as the tool call
  • not buffering streamed tool_calls arguments until they are complete