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

Open
#5 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet

Research direction

Start at the connectOpenAi call in the Next.js app and review the listed @stream-io/node-sdk and @stream-io/openai-realtime-api versions alongside the Vercel deployment. Reproduce the successful client_secrets request and the failing agent connection, then determine whether the setup is supported and which Stream settings, permissions, or entitlements are required.

Written by the indexing model from the issue text.

Description

Hi Stream team,

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

Packages:

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?

Dominant language
JavaScript
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GetStream/openai-tutorial-node

All issues in GetStream/openai-tutorial-node

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.