openai · OpenAI Platform Docs
WebSocket Mode
Implements a persistent WebSocket connection to the Responses API to manage long-running, multi-turn workflows involving frequent tool calls by sending incremental inputs and chaining response IDs.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
WebSocket Mode
Implements a persistent WebSocket connection to the Responses API to manage long-running, multi-turn workflows involving frequent tool calls by sending incremental inputs and chaining response IDs.
When To Use
Use when building agentic loops or orchestration workflows that require many model-tool round trips and need to minimize end-to-end latency through incremental state updates.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/websocket-mode-workflow-guide.md | A guide explaining how to use the WebSocket mode for the Responses API to manage long-running, tool-call-heavy workflows via persistent connections. | Questions about a guide explaining how to use the WebSocket mode for the Responses API to manage long-running, tool-call-heavy workfl... |
examples/websocket-mode-openai-websocket-mode-python-response-create.python | A Python script demonstrating how to establish a WebSocket connection to the OpenAI API to send a response.create event. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to establish a WebSocket connection to the OpenAI API to send a response.create event. |
examples/websocket-mode-openai-websocket-mode-python-response-create-2.python | A Python code snippet demonstrating how to send a response.create message via a WebSocket connection to the OpenAI API. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to send a response.create message via a WebSocket connection to the OpenAI API. |
examples/websocket-mode-openai-websocket-mode-python-compact-and-response-create.python | A Python example demonstrating how to compact an existing HTTP response window and initiate a new response via a WebSocket connection. | Exact payloads, commands, or snippets shown in A Python example demonstrating how to compact an existing HTTP response window and initiate a new response via a WebS... |
examples/websocket-mode-openai-websocket-mode-error-response.json | A JSON object demonstrating an error response structure for a missing previous response ID during a WebSocket session. | Exact payloads, commands, or snippets shown in A JSON object demonstrating an error response structure for a missing previous response ID during a WebSocket session. |
examples/websocket-mode-openai-websocket-mode-error-response-2.json | A JSON object demonstrating a websocket connection limit error response from the OpenAI API. | Exact payloads, commands, or snippets shown in A JSON object demonstrating a websocket connection limit error response from the OpenAI API. |
What This Skill Covers
- The Responses API supports a WebSocket mode for long-running, tool-call-heavy workflows. In this mode, you keep a persistent connection to /v1/responses and...
- Main sections:
Why use WebSocket mode,Connect and create responses,Continue with incremental inputs,How continuation works,Compaction and creating new responses.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/websocket-mode.md
