Built-in tools are handled server-side. Unlike custom function calling (where your code executes the function), built-in tools execute automatically and return results to the model within the same request.
Available Built-in Tools
Web Search
Enable web search to let the model look up current information that isn’t in its training data.- Python
- Node.js
- cURL
output array includes a web_search_call item showing what was searched:
Code Interpreter
Let the model write and execute Python code to solve math problems, analyze data, or generate charts.- Python
- Node.js
output array will include a code_interpreter_call item with the code that was executed:
Combining Multiple Tools
You can enable multiple built-in tools in the same request. The model decides which to use based on the input.- Use web search to find current population data
- Use code interpreter to generate the chart
- Return the final answer with both tool calls visible in the
outputarray
Mixing Built-in and Custom Tools
You can combine built-in tools with your own custom function definitions:Tool Choice
Control how the model selects tools withtool_choice:
Best Practices
Be specific about when to search
If your prompt clearly needs current data, enable web search. For questions answerable from training data, skip it to save latency.
Use code interpreter for computation
Models are better at writing code than doing arithmetic. For math-heavy tasks, enable code interpreter for accurate results.
Check output items
Inspect the
output array to see which tools were used and verify the model’s reasoning chain.Combine thoughtfully
Enabling too many tools can confuse the model. Enable only the tools relevant to the task at hand.