SpyBara
Go Premium

python/resources/responses/methods/connect/index.md 2026-06-09 06:34 UTC to 2026-06-10 15:48 UTC

This page contains 19 additions and 0 deletions.

2026
Wed 10 15:48

responses.connect()

**** ``

Connect to a persistent Responses API WebSocket. Send response.create events and receive response stream events over the socket.

Example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
client.responses.connect()