Skip to main content
The Responses API (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_call item; 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 an output array with typed items:

System instructions

Use the instructions parameter to provide system-level guidance:

Multi-turn conversations

Since the API is stateless, include the full conversation history in the input array:

Function calling

The Responses API supports function tools for agentic workflows. Only type: "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 with tool_choice:

Structured output (JSON mode)

Request structured JSON output using the text.format parameter.

JSON object mode

JSON schema mode

For guaranteed structure, provide a JSON schema:

Reasoning

Reasoning-capable models expose their thinking process via reasoning output items. Control reasoning depth with reasoning.effort:
When using gpt-oss-120b for function calling, set reasoning.effort to "high" for best results.

Streaming

Enable streaming for real-time output with stream: true. The API emits Server-Sent Events:

Streaming event types

Request parameters

Response fields

Usage statistics

The usage object includes performance metrics:

Responses API vs Chat Completions

Limitations

  • Stateless: previous_response_id is not supported—supply full conversation history in input[]
  • Function tools only: Built-in tools (web_search, code_interpreter) are not supported
  • Not implemented: frequency_penalty, presence_penalty, max_tool_calls, strict mode

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