OpenAI Function Calling Guide
OpenAI's official guide to function calling in the Responses API: defining function tools with JSON Schema, reading function_call items, returning function_call_output, tool_choice, parallel calls and strict mode. Read it alongside the Claude tool use docs and the shared shape of every agent loop becomes obvious.
Free
OpenAI Developers · Sept 2026
Guide
AI & Machine Learning
OpenAI
2 to 3 hours to read and try
Intermediate
Free
What the guide teaches
Function calling is OpenAI's name for tool calling: the model replies with a request to run one of your functions, your code runs it, and you send the result back. This guide is the official walkthrough for the Responses API, OpenAI's current interface for building assistants and agents.
It covers:
- Defining function tools: each tool has
type: "function", aname, adescriptionand aparametersJSON Schema. - Reading calls: the response output contains
function_callitems with acall_id, the function name and JSON-encodedarguments. - Returning results: you append a
function_call_outputitem with the samecall_idand the result, then call the model again. - Tool choice:
autoby default,requiredto force at least one call, a named function to force that one, ornone. - Parallel calls: several calls in one turn, and
parallel_tool_calls: falsewhen you want at most one. - Strict mode:
strict: trueso arguments always match the schema, which requiresadditionalProperties: falseand every field listed as required.
The guide also covers streaming function calls, tool search for large tool sets, namespaces and custom tools.
Why read it if you already know another provider
Because the concepts transfer almost one to one. Anthropic calls the same things input_schema, tool_use and tool_result; OpenAI calls them parameters, function_call and function_call_output. Seeing two providers side by side is the fastest way to understand what is essential to tool calling and what is just naming, which is exactly the knowledge you need to write a thin adapter or use a gateway that switches models.
Prerequisites and time
Comfort with Python or JavaScript, JSON and making an HTTP or SDK request. Reading the guide and running its examples takes two to three hours. Keep it open as reference while you build.
Free or paid?
Reading is free. Running the examples needs an OpenAI API key, and usage is billed per token, so set a monthly budget in your account before experimenting.
What you can do after it
Build a manual tool loop on the Responses API, write strict schemas that pass validation, handle parallel calls and explain the differences between OpenAI and Anthropic tool calling in an architecture review.
Common questions
Is this the same as the OpenAI Agents SDK? No. The guide is the raw API; the Agents SDK is a framework built on top of it that runs the loop, handoffs and tracing for you.
Does Chat Completions still support function calling? Yes, and the guide shows examples for both interfaces, but it notes that some newer models require the Responses API for tool calling, so start new agents there.
Ready to start?
Opens on OpenAI in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.