Responses API
Use the Responses API for applications and coding tools built around OpenAI's response-item format.
Basic request
The response includes an output array containing response items. SDKs may provide an output_text convenience property for aggregated text.
Python
Node.js / TypeScript
Common request fields
Continue a response
For workflows that support response continuation, pass the previous response ID:
Support for stateful continuation can depend on the selected model and upstream service.
Compact context
GetRouter exposes the Responses compaction endpoint:
It accepts model plus input, instructions, or previous_response_id. Use it only when your client implements the Responses compaction workflow.
Streaming
Set stream to true to receive Responses API events. These are not the same as Chat Completions chunks. See Streaming.
Compatibility notes
- Use a model that supports the Responses endpoint.
- Do not assume a model that works with Chat Completions also supports Responses.
- Tools such as Codex may depend on Responses-specific event and tool formats, so configure them with a dedicated integration guide.
