Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Connect

client.beta.responses.connect(RequestOptionsoptions?): void
Function

Connect to a persistent Responses API WebSocket. Send response.create events to create responses and response.steer events to queue user input containing text, images, or files for a continuation. Receive response stream events and steering acceptance, pending, or failure events over the socket.

Connect

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

await client.beta.responses.connect();
Returns Examples