OpenAI Function Calling
OpenAI Function Calling (also known as tool calling) is a mechanism by which OpenAI models interact with external systems, allowing the model, while generating a response, to call functions or custom tools provided by the application in order to obtain information beyond its training data or to perform operations. Developers define functions via JSON Schema; the model determines based on the prompt whether a call is needed and returns a tool call request containing arguments; the application executes the corresponding code and passes the result back to the model, which then generates the final response. This mechanism supports integration with the Responses API and Chat Completions, and is suitable for scenarios requiring real-time data, business operations, or external system integration.