Tool Calling
Alpha API
This API is in alpha stage and may have breaking changes.
The Responses API Alpha supports comprehensive tool calling capabilities, allowing models to call functions, execute tools in parallel, and handle complex multi-step workflows.
Basic Tool Definition
Define tools using the OpenAI function calling format:
Tool Choice Options
Control when and how tools are called:
Force Specific Tool
Disable Tool Calling
Multiple Tools
Define multiple tools for complex workflows:
Parallel Tool Calls
The API supports parallel execution of multiple tools:
Tool Call Response
When tools are called, the response includes function call information:
Tool Responses in Conversation
Include tool responses in follow-up requests:
Required Field
The id
field is required for function_call_output
objects when including tool responses in conversation history.
Streaming Tool Calls
Monitor tool calls in real-time with streaming:
Tool Validation
Ensure tool calls have proper structure:
Required fields:
type
: Always “function_call”id
: Unique identifier for the function call objectname
: Function name matching tool definitionarguments
: Valid JSON string with function parameterscall_id
: Unique identifier for the call
Best Practices
- Clear descriptions: Provide detailed function descriptions and parameter explanations
- Proper schemas: Use valid JSON Schema for parameters
- Error handling: Handle cases where tools might not be called
- Parallel execution: Design tools to work independently when possible
- Conversation flow: Include tool responses in follow-up requests for context
Next Steps
- Learn about Web Search integration
- Explore Reasoning with tools
- Review Basic Usage fundamentals