Skip to content

connectOpenAi fails with server_error code 42 while OpenAI Realtime direct test succeeds #5

@nuengdev1111

Description

@nuengdev1111

Hi Stream team,

I’m using Stream Video with OpenAI Realtime in a Next.js app deployed on Vercel.

Packages:

  • @stream-io/node-sdk@0.7.59
  • @stream-io/openai-realtime-api@0.3.3
  • Next.js 15.3.8
  • Deployed on Vercel

OpenAI Realtime direct test succeeds:

POST https://api.openai.com/v1/realtime/client_secrets
model: gpt-4o-realtime-preview
status: 200 OK

But Stream connectOpenAi fails:

const realtimeClient = await streamVideo.video.connectOpenAi({
call,
openAiApiKey: process.env.OPENAI_API_KEY,
agentUserId: "lucy",
model: "gpt-4o-realtime-preview",
});

Error:

{
type: "error",
error: {
type: "server_error",
code: "42",
message: "Error: code ",
param: null,
event_id: ""
}
}

Additional context:

  • The Stream call is created successfully.
  • The user joins successfully.
  • The agent user "lucy" appears to join and then leaves.
  • Webhooks show call.session_participant_joined and call.session_participant_left for lucy.
  • OpenAI Realtime client_secret endpoint returns 200 OK, so the OpenAI key and Realtime access appear valid.

Can you confirm whether connectOpenAi currently supports this setup, and whether any Stream app settings, permissions, or entitlements are required for OpenAI Realtime agents?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions