Skip to content

Conversation

seratch
Copy link
Member

@seratch seratch commented Oct 20, 2025

This pull request resolves #1880; Realtime API accepts sk-proj-... token for starting a WebSocket connection, but with this way, the Realtime API's server side tracing no longer works. This pattern may be supported again, but as a quick fix for affected users, this SDK migrates to the new way to establish a WebSocket connection.

Copy link
Member Author

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments for reviewers


headers: dict[str, str] = {}
if options.get("headers") is not None:
subprotocols: list[Subprotocol] = [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a fundamental change for the issue, but having these is generally recommended and aligning with TS SDK.

if api_key.startswith("ek_"):
ephemeral_key = api_key
else:
ephemeral_key = await self._maybe_create_client_secret(api_key, self.model)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creating an ephemeral key for establishing a WS connection is the recommended way while both still work in terms of realtime capabilities. Going with an ephemeral key resolves the tracing feature issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using an ephemeral key for server <-> server communication seems like unnecessary overhead to me.

if api_key.startswith("ek_"):
ephemeral_key = api_key
else:
ephemeral_key = await self._maybe_create_client_secret(api_key, self.model)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using an ephemeral key for server <-> server communication seems like unnecessary overhead to me.

@seratch
Copy link
Member Author

seratch commented Oct 20, 2025

Update: this PR applies a workaround on the client SDK side, but the realtime API server team is going to resolve this issue soon. This means this PR's changes won't be necessary.

@seratch seratch closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to Enable Tracing For Realtime Runner?

2 participants