This skill should be used when implementing, consuming, or debugging an Open Responses-compliant API — the open standard for multi-provider LLM interoperability. Covers protocol, items, state machines, streaming events, tools, the agentic loop pattern, and extensions. Triggers on: Open Responses, open-responses, /v1/responses endpoint, multi-provider LLM API, Open Responses compliance.
Open Responses is an open-source specification defining a unified HTTP protocol for multi-provider LLM interactions. It standardizes how clients and servers communicate — messages, tool calls, streaming, multimodal inputs, reasoning — so that code written against one provider works with any compliant provider.
This is the protocol standard itself, not any specific SDK. Open Responses is provider-agnostic. Any LLM provider (OpenAI, Anthropic, Gemini, Databricks, Hugging Face, Ollama, etc.) can implement a compliant API.
Stateless by default, stateful where needed. The core protocol does not require server-side session persistence. Multi-turn conversations can be threaded via
previous_response_id
, which instructs the server to reconstruct context from prior responses. However, providers may offer stateful features (e.g., server-side storage, conversation objects) as extensions. The spec notes that item states "do not necessarily mean they are stateful in the sense of being persisted to disk or stored long-term."
Design Principles
Multi-provider compatibility — one schema, any provider
Stateless-first protocol — context reconstruction via
previous_response_id
; providers may optionally offer persistence
Polymorphic items — all model outputs share a common item structure discriminated by
type
Semantic streaming — SSE events map directly to state machine transitions
Extensible without fragmentation — vendor-prefixed extensions prevent namespace collisions
(position within a content part). Servers SHOULD NOT use the SSE
id
field.
Streaming Events
Two categories of SSE events:
Delta events — incremental content:
response.output_text.delta
,
response.function_call_arguments.delta
,
response.output_item.added
,
response.output_item.done
, etc.
Lifecycle events — state transitions:
response.created
,
response.queued
,
response.in_progress
,
response.completed
,
response.incomplete
,
response.failed
Rule: the
event
SSE header must match the
type
field inside the JSON body.
Tools
Open Responses defines two tool categories based on execution location.
Externally-hosted tools — implementation lives outside the provider's system. The model requests invocation via
function_call
items, and the developer must supply results as
function_call_output
items in a follow-up request. Note that "externally hosted" does not always mean the developer executes the tool locally — MCP tools are externally hosted (the implementation lives on external servers), but control is not necessarily yielded back to the developer first. Examples: function tools, MCP server tools.
Internally-hosted tools — implementation lives inside the provider's system. The provider executes without yielding control and returns results as provider-specific item types within the same response. These items must be losslessly round-trippable in follow-up requests. Examples: file search, code interpreter, web search.
Tool Definition
json
{"type":"function","name":"get_weather","description":"Get current weather for a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"City name"},"units":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}
Tool Control
The
tool_choice
parameter controls whether and how the model uses tools:
Stateless-first iteration — Each loop iteration is a new HTTP request. The server reconstructs context from
previous_response_id
. Providers may optionally persist state, but the protocol does not require it.
Developer controls external tool execution — For externally-hosted function tools, the developer decides when to execute, what results to return, and whether to continue. For MCP tools (also externally hosted), execution may happen without first yielding control to the developer.
Parallel tool calls — The model may emit multiple
function_call
items in a single response. Execute all of them and return all results in one follow-up request.
Loop termination — The loop ends when no client-satisfied external tool calls remain in the response. The final response may contain not just
message
items but also
reasoning
items, internally-hosted tool items, and other non-message output items.
Provider handles internal tools — For internally-hosted tools, the provider executes within the same request and returns provider-specific item types. No developer loop required.
Example: Multi-Tool Agent
Turn 1 — Request with tools:
json
{"model":"provider/model-name","input":[{"type":"message","role":"user","content":"Compare the weather in Paris and Tokyo."}],"tools":[{"type":"function","name":"get_weather","description":"Get current weather for a city","parameters":{"type":"object","properties":{"location":{"type":"string"}},"required":["location"]}}]}
Turn 1 — Model emits two parallel function_call items:
Turn 2 — Model synthesizes final answer (no function_call items = loop ends):
json
{"id":"resp_101","status":"completed","output":[{"id":"item_200","type":"message","role":"assistant","status":"completed","content":[{"type":"output_text","text":"Paris is currently 18°C and partly cloudy. Tokyo is warmer at 24°C with sunny skies."}]}]}
Multi-Turn Conversations
Multi-turn conversations use
previous_response_id
to chain context. The server reconstructs the full conversation by walking the response chain (providers may also support server-side persistence as an extension):
Server loads: previous_response.input + previous_response.output + new_input
json
// Turn 1{"model":"provider/model-name","input":[{"type":"message","role":"user","content":"What is the population of France?"}]}// Response: {"id": "resp_200", ...}// Turn 2 — references Turn 1{"model":"provider/model-name","previous_response_id":"resp_200","input":[{"type":"message","role":"user","content":"And what about Germany?"}]}
Extensions
Open Responses supports four extension mechanisms, all using vendor-prefixed names to prevent collisions. For full details with examples, load
references/extensions.md
.
Mechanism
Naming Pattern
Required Fields
Constraint
Custom Items
vendor:type_name
id
,
type
,
status
Must follow item state machine, must round-trip
Custom Events
vendor:event_name
type
,
sequence_number
Must not alter core semantics or token order
Schema Extensions
vendor-prefixed fields
N/A (optional fields)
Must not break clients ignoring unknown fields
Governance Path
N/A
N/A
Broad adoption -> TSC proposal -> core spec
Clients must silently ignore unknown item types and event types — this is the forward-compatibility contract.
Compliance
An API is Open Responses-compliant if it implements the spec directly or is a proper superset. The published acceptance test suite is available at https://www.openresponses.org/.
Core Compliance Tests
Test
Validates
Basic Text Response
ResponseResource schema, item structure, usage
Streaming Response
SSE events, correct ordering, final structure
System Prompt
instructions
parameter, system role handling
Tool Calling
Function tool definition, function_call output, round-tripping
Image Input
Image URL in user content
Multi-turn Conversation
Message history, assistant + user turns
Server Implementation Checklist
POST /v1/responses
endpoint with
Authorization
header
Valid output items with
id
,
type
,
status
; input items per their type requirements
Item state machine:
in_progress
->
completed
/
incomplete
Response state machine:
created
->
queued
->
in_progress
->
completed
/
incomplete
/
failed
Emit all 6 lifecycle events:
response.created
,
.queued
,
.in_progress
,
.completed
,
.incomplete
,
.failed
Response
incomplete
when any item ends
incomplete
Non-streaming JSON and streaming SSE with
event
/
type
matching
data: [DONE]
terminal marker
Function tools:
function_call
items,
function_call_output
round-tripping
previous_response_id
for conversation continuation
Error objects:
type
,
code
,
param
,
message
with correct HTTP status codes
Vendor-prefixed extensions (if applicable)
Client Implementation Checklist
Send
Authorization
and
Content-Type
headers
Parse polymorphic items by
type
field
Track item and response state machines
Process SSE: parse
event:
+
data:
lines, handle
[DONE]
Implement agentic loop for externally-hosted tools
Silently ignore unknown item types and event types