POST /v1/responses) is designed for agentic workflows and tool-capable integrations. It structures model output as typed items—messages, function calls, and reasoning—rather than a single text field, enabling sophisticated multi-step agent interactions.
The Responses API complements the Chat Completions API and does not replace it. Use Responses API for agentic workflows and tool calling; use Chat Completions for simpler conversational needs.
Supported models
Not all models support the Responses API. Models like
DeepSeek-V3.1 and Meta-Llama-3.3-70B-Instruct are only available via Chat Completions.Key characteristics
- Structured output items: Responses contain typed items (
message,function_call,reasoning) rather than a single text field - Stateless: Infercom does not store conversation state—supply full history via
input[]on each request - Client-executed tools: When a tool is needed, the model returns a
function_callitem; your application executes the function and returns the result - Streaming: Server-Sent Events with typed event hierarchy for real-time output
Simple generation
The simplest usage passes a string input and receives a structured response.Response structure
The response contains anoutput array with typed items:
System instructions
Use theinstructions parameter to provide system-level guidance:
Multi-turn conversations
Since the API is stateless, include the full conversation history in theinput array:
Function calling
The Responses API supports function tools for agentic workflows. Onlytype: "function" tools are supported.
Step 1: Define tools and make initial request
Step 2: Execute function and return result
Tool choice
Control when the model uses tools withtool_choice:
Structured output (JSON mode)
Request structured JSON output using thetext.format parameter.
JSON object mode
JSON schema mode
For guaranteed structure, provide a JSON schema:Reasoning
Reasoning-capable models expose their thinking process viareasoning output items. Control reasoning depth with reasoning.effort:
Streaming
Enable streaming for real-time output withstream: true. The API emits Server-Sent Events:
Streaming event types
Request parameters
Response fields
Usage statistics
Theusage object includes performance metrics:
Responses API vs Chat Completions
Limitations
- Stateless:
previous_response_idis not supported—supply full conversation history ininput[] - Function tools only: Built-in tools (web_search, code_interpreter) are not supported
- Not implemented:
frequency_penalty,presence_penalty,max_tool_calls,strictmode
Agentic coding integrations
The Responses API powers agentic coding tools. See integration guides:- OpenCode - Terminal-based coding assistant
- Cline - VS Code extension
- Aider - Terminal pair programming
Next steps
- Function Calling - Detailed function calling guide for Chat Completions
- Text Generation - Chat Completions API guide
- API Reference - Full endpoint documentation