Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Guide · AI & Machine LearningFree

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.

Cost to read

Free

OpenAI Developers · Sept 2026

Format

Guide

Topic

AI & Machine Learning

Provider

OpenAI

Time needed

2 to 3 hours to read and try

Level

Intermediate

Access

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", a name, a description and a parameters JSON Schema.
  • Reading calls: the response output contains function_call items with a call_id, the function name and JSON-encoded arguments.
  • Returning results: you append a function_call_output item with the same call_id and the result, then call the model again.
  • Tool choice: auto by default, required to force at least one call, a named function to force that one, or none.
  • Parallel calls: several calls in one turn, and parallel_tool_calls: false when you want at most one.
  • Strict mode: strict: true so arguments always match the schema, which requires additionalProperties: false and 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.

aillmpythontypescriptbackend

Ready to start?

Opens on OpenAI in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "OpenAI Function Calling Guide". Only Tauseef reads this.

Work with me

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.