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_call items (Responses)
Anthropic
tool_use blocks, answered with tool_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

  • The call

    OpenAI Chat Completions
    message.tool_calls; finish_reason is tool_calls
    OpenAI Responses
    A function_call item in output
    Anthropic Messages
    A tool_use block; stop_reason is tool_use
  • The result

    OpenAI Chat Completions
    A tool message with the call's tool_call_id
    OpenAI Responses
    A function_call_output item
    Anthropic Messages
    A tool_result block 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 its tool_calls to the conversation, then one tool message per call with its tool_call_id, and send the request again.
  • On /v1/messages, add Claude's whole answer unchanged, thinking blocks included, then a user message with a tool_result block 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.

One key for every model here.

Top up from $10, change one URL, and pay only for the tokens you use.