Source: OpenAI Function Calling Guide
OpenAI API guide to function calling in the Responses API: strict schemas, tool_choice, parallel calls, custom grammar tools, tool search and streaming.
Contents
- What: official API documentation page
- Author/publisher: OpenAI
- Date: living document; read 2026-11-14
- Original: Function calling
Summary
Explains how to declare function tools in the Responses API, how the model emits function_call output items and how to return function_call_output items, plus strict mode, tool choice, parallel calling, free-form “custom” tools constrained by a grammar, namespaces with deferred loading and tool search, token costs and streaming events.
Key claims
- A function tool has
type: "function",name,description,parameters(JSON Schema), optionalstrict. - Strict mode requires
additionalProperties: falseand every property inrequired; optional fields are expressed as a union withnull. In Responses, omittedstrictmeans the API tries to normalise to strict and falls back if it cannot; Chat Completions defaults to non-strict. tool_choice:auto,required, a specific function,allowed_tools(subset without changing the tool list, which preserves the prompt cache),none.parallel_tool_calls: falselimits the model to zero or one call per turn; built-in tools can’t join a parallel batch.- Calls carry a
call_id; results go back asfunction_call_outputwith the samecall_id. Reasoning items must be passed back alongside tool outputs. - Custom tools take free-form text, optionally constrained by a Lark or regex (Rust syntax) grammar.
- Tool definitions are injected into the context and billed as input tokens; keep fewer than about 20 functions available at turn start (soft guideline);
tool_searchwithdefer_loadingloads tools on demand (gpt-5.4+). - Streaming:
response.output_item.addedopens a call,response.function_call_arguments.deltastreams argument fragments,.donecarries the full arguments.