Features
Function calling
Function calling is a model's ability to answer with a request to run one of the functions an app described, with arguments, instead of with text. The app runs the function and sends the result back.
Also called Tool calling, Tool use, Tool calls
Checked November 29, 2026
At a glance
- Runs the function
- Your app, never the model
- Described in
tools: a name, a description, a JSON schema of the parameters- OpenAI
tool_calls(Chat);function_callitems (Responses)- Anthropic
tool_useblocks, answered withtool_result- On /model
- GPT and Claude, in the OpenAI format; Claude also in Anthropic's
The model never runs anything itself. You describe each function in tools, with a name, a description and a JSON schema of its parameters. The model decides whether to call one; your code runs it; the result goes back into the conversation; and the model answers with it. Agents repeat this loop, call after call.
In each format
| OpenAI Chat Completions | OpenAI Responses | Anthropic Messages | |
|---|---|---|---|
| The call | message.tool_calls; finish_reason is tool_calls | A function_call item in output | A tool_use block; stop_reason is tool_use |
| The result | A tool message with the call's tool_call_id | A function_call_output item | A tool_result block in a user message |
The call
- OpenAI Chat Completions
message.tool_calls;finish_reasonistool_calls- OpenAI Responses
- A
function_callitem inoutput - Anthropic Messages
- A
tool_useblock;stop_reasonistool_use
The result
- OpenAI Chat Completions
- A
toolmessage with the call'stool_call_id - OpenAI Responses
- A
function_call_outputitem - Anthropic Messages
- A
tool_resultblock in a user message
OpenAI documents both of its formats (OpenAI). Anthropic tells apart client tools, which run in your app, and server tools, such as web search, which run on Anthropic's side (Anthropic).
Tool calls on /model
- GPT and Claude models take tools in the OpenAI format, and Claude also in Anthropic's (Tool calls).
- On
/v1/chat/completions, add the assistant message with itstool_callsto the conversation, then onetoolmessage per call with itstool_call_id, and send the request again. - On
/v1/messages, add Claude's whole answer unchanged, thinking blocks included, then a user message with atool_resultblock per call. - Web search, Anthropic's server tool, is charged per search, at the same discount as the channel's tokens (Balance).
Where it applies on /model
Questions
Is tool calling the same as function calling?
Yes. OpenAI says function calling and Anthropic says tool use; both mean the model asking your code to run something.
Do I pay for the tool definitions?
Yes. The tools list is part of the input, so it is billed as input tokens with every request. It can be cached with the rest of the prompt's start.
Sources
The makers' own pages, each opened on November 29, 2026.