Skip to content

[BOT ISSUE] OpenAI Realtime API not instrumented — zero visibility for real-time voice/text sessions #1731

@braintrust-bot

Description

@braintrust-bot

Summary

The OpenAI Node SDK provides a GA Realtime API (client.realtime) for low-latency, bidirectional voice and text interaction with GPT-4o models. This repo has zero instrumentation for any Realtime API surface — no channels, no plugin handlers, no wrapper proxies, and no auto-instrumentation configs. Users building voice-enabled AI applications with the OpenAI Realtime API get no Braintrust spans at all.

What instrumentation is missing

No coverage in any layer:

  • Wrapper (js/src/wrappers/oai.ts): No proxy for the realtime resource. Only chat.completions, embeddings, moderations, and responses are wrapped.
  • Auto-instrumentation config (js/src/auto-instrumentations/configs/openai.ts): No config entry for any realtime.* methods.
  • Channels (js/src/instrumentation/plugins/openai-channels.ts): No channel definitions for Realtime API.
  • Plugin (js/src/instrumentation/plugins/openai-plugin.ts): No handler for Realtime calls.
  • Vendor types (js/src/vendor-sdk-types/openai-common.ts): No type definitions for Realtime resources.

A grep for RealtimeSession, clientSecrets, and realtime.connect across js/src/ returns zero matches.

Key upstream API surfaces with no Braintrust tracing:

SDK Method Description
client.realtime.clientSecrets.create() HTTP POST — creates an ephemeral client secret/token for WebSocket connection. Accepts model, voice, tools, instructions, and other session config.
RealtimeSession class WebSocket session that emits events including response.done (with full usage metrics: input/output audio tokens, text tokens), conversation.item.created, tool call events, and error events.

The clientSecrets.create() call is a standard HTTP request that could be instrumented like any other method to give session-level visibility. The RealtimeSession event stream is architecturally different (WebSocket-based) but its response.done events contain usage metrics that are directly analogous to what's captured for chat.completions.create() and responses.create().

Braintrust docs status

not_found — The Braintrust docs at https://www.braintrust.dev/docs/instrument/wrap-providers document OpenAI as a supported provider for standard LLM calls and streaming, but make no mention of the Realtime API, real-time voice, or WebSocket-based interactions.

Upstream reference

Local files inspected

  • js/src/wrappers/oai.ts — no realtime property interception
  • js/src/auto-instrumentations/configs/openai.ts — no Realtime configs
  • js/src/instrumentation/plugins/openai-channels.ts — no Realtime channels
  • js/src/instrumentation/plugins/openai-plugin.ts — no Realtime handlers
  • js/src/vendor-sdk-types/openai-common.ts — no Realtime types
  • e2e/scenarios/openai-instrumentation/ — no Realtime test scenarios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions