Fix OpenAI Realtime: use /v1/realtime/client_secrets (old /sessions returns 404)#2
Open
suyash-lyzr wants to merge 1 commit into
Conversation
…eturns 404)
OpenAI retired POST /v1/realtime/sessions; it now returns HTTP 404
'Invalid URL', so voice mode fails to obtain an ephemeral token and the
UI shows a misleading 'no API key set' error for every user.
Migrate both the initial-connect and refresh paths to the current
endpoint POST /v1/realtime/client_secrets:
- body: { model } -> { session: { type: 'realtime', model } }
- response: session.client_secret.value -> session.value (top-level)
Verified live: old endpoint -> 404, new endpoint with this exact request
-> 200 with a top-level ephemeral 'value'. tsc build passes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Voice mode is broken for all OpenAI Realtime users:
POST https://api.openai.com/v1/realtime/sessionsnow returns HTTP 404 "Invalid URL" — OpenAI retired that endpoint.openai-realtime.tscalls it to mint the ephemeral token, so the WebSocket never connects, and the UI shows a misleading "no API key set" banner even when the key is valid.Reproduced live (valid key):
Fix
Migrate both the initial-connect and refresh paths in
src/openai-realtime.tsto the current endpoint:/v1/realtime/sessions/v1/realtime/client_secrets{ model }{ session: { type: "realtime", model } }session.client_secret.valuesession.value(top-level)Verification
{"session":{"type":"realtime","model":"gpt-realtime-2025-08-28"}}) → HTTP 200 with a top-levelvalueephemeral key (ek_...).npm run build(tsc) passes clean.🤖 Generated with Claude Code