You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both the official openai gem and the community ruby-openai gem expose OpenAI's Realtime API — a low-latency, speech-to-speech (and SIP call-control) generative execution surface — and neither is instrumented by this SDK. This is a distinct generative execution path from the already-instrumented Chat Completions and Responses APIs: it establishes a session (via an ephemeral client secret) that then drives a live, bidirectional model conversation over WebRTC/WebSocket, optionally with tool calling and VAD-based turn detection.
What is missing
Official openai gem
client.realtime exposes (per OpenAI's official Ruby API reference):
client.realtime.client_secrets.create(**kwargs) → POST /realtime/client_secrets — mints the ephemeral session + client_secret used to open the actual realtime connection. This is the generative-session-initiating call, analogous to chat.completions.create for this API family.
client.realtime.calls.accept/hangup/refer/reject(call_id, **kwargs) → SIP call-control endpoints for realtime phone calls.
Related sub-resources: RealtimeSessions, RealtimeTranscriptionSessions, RealtimeTranslations (+ their own client_secrets), and a large client/server event model (RealtimeClientEvent/RealtimeServerEvent, SessionCreatedEvent, conversation items, tool/MCP integration, VAD/turn-detection config).
None of this is wrapped by any Patcher in this repo — lib/braintrust/contrib/openai/patcher.rb only defines ChatPatcher, ResponsesPatcher, ModerationsPatcher.
Maturity note: RealtimeSession is documented as "for the beta interface," and there's a separate legacy "Realtime Beta" section — so the surface is evolving, not hardened GA, but it is officially documented and shipped in the gem today (gem is pre-1.0, ~v0.69 as of July 2026).
ruby-openai gem
client.realtime.create(parameters: { model: "gpt-4o-realtime-preview-2024-12-17" }) — documented in the gem's own README, returns a session object plus a client_secret (ephemeral key) used to establish a WebRTC peer connection. The README's tagline explicitly advertises "Realtime WebRTC conversations" as a supported feature.
lib/braintrust/contrib/ruby_openai/patcher.rb has the same three patchers (ChatPatcher, ResponsesPatcher, ModerationsPatcher) and no realtime equivalent.
unclear — https://www.braintrust.dev/docs/integrations/ai-providers/openai mentions the Realtime API exactly once, as a Cookbooks link title ("Evaluating audio with the OpenAI Realtime API" → `/docs/cookbook/recipes/Realtime"), with no description of what tracing/instrumentation support exists, and no connection to Ruby anywhere on the page. The page's Ruby-specific tracing table only documents Chat Completion, Responses, and Moderations. https://www.braintrust.dev/docs/integrations/sdk-integrations does not mention Realtime at all.
lib/braintrust/contrib/openai/patcher.rb — defines ChatPatcher, ResponsesPatcher, ModerationsPatcher; no realtime patcher
lib/braintrust/contrib/openai/instrumentation/ — contains chat.rb, responses.rb, moderations.rb, common.rb; no realtime.rb
lib/braintrust/contrib/ruby_openai/patcher.rb and lib/braintrust/contrib/ruby_openai/instrumentation/ — same file set, same gap
Grep for realtime/Realtime across lib/braintrust/, test/, and examples/ returns zero matches anywhere in code, tests, or examples (only unrelated cassette filename false-positives)
Searched all 48 currently-open issues in this repo for "realtime" — zero matches, confirming this is a distinct, non-duplicate gap
Summary
Both the official
openaigem and the communityruby-openaigem expose OpenAI's Realtime API — a low-latency, speech-to-speech (and SIP call-control) generative execution surface — and neither is instrumented by this SDK. This is a distinct generative execution path from the already-instrumented Chat Completions and Responses APIs: it establishes a session (via an ephemeral client secret) that then drives a live, bidirectional model conversation over WebRTC/WebSocket, optionally with tool calling and VAD-based turn detection.What is missing
Official
openaigemclient.realtimeexposes (per OpenAI's official Ruby API reference):client.realtime.client_secrets.create(**kwargs)→POST /realtime/client_secrets— mints the ephemeral session +client_secretused to open the actual realtime connection. This is the generative-session-initiating call, analogous tochat.completions.createfor this API family.client.realtime.calls.accept/hangup/refer/reject(call_id, **kwargs)→ SIP call-control endpoints for realtime phone calls.RealtimeSessions,RealtimeTranscriptionSessions,RealtimeTranslations(+ their ownclient_secrets), and a large client/server event model (RealtimeClientEvent/RealtimeServerEvent,SessionCreatedEvent, conversation items, tool/MCP integration, VAD/turn-detection config).Patcherin this repo —lib/braintrust/contrib/openai/patcher.rbonly definesChatPatcher,ResponsesPatcher,ModerationsPatcher.RealtimeSessionis documented as "for the beta interface," and there's a separate legacy "Realtime Beta" section — so the surface is evolving, not hardened GA, but it is officially documented and shipped in the gem today (gem is pre-1.0, ~v0.69 as of July 2026).ruby-openaigemclient.realtime.create(parameters: { model: "gpt-4o-realtime-preview-2024-12-17" })— documented in the gem's own README, returns a session object plus aclient_secret(ephemeral key) used to establish a WebRTC peer connection. The README's tagline explicitly advertises "Realtime WebRTC conversations" as a supported feature.lib/braintrust/contrib/ruby_openai/patcher.rbhas the same three patchers (ChatPatcher,ResponsesPatcher,ModerationsPatcher) and no realtime equivalent.What a span should capture
client_secrets.create/realtime.create(model, modalities, voice, instructions, tools, turn-detection config)openai),model, sessionid,expires_atvalueitself, which should not be logged)client.messages.batches) not instrumented #169, [bot] RubyLLM provider-side batch completions (RubyLLM.batch) not instrumented #193, [bot] OpenAI Batch API (client.batches.create) not instrumented (openai + ruby-openai gems) #196)Braintrust docs status
unclear— https://www.braintrust.dev/docs/integrations/ai-providers/openai mentions the Realtime API exactly once, as a Cookbooks link title ("Evaluating audio with the OpenAI Realtime API" → `/docs/cookbook/recipes/Realtime"), with no description of what tracing/instrumentation support exists, and no connection to Ruby anywhere on the page. The page's Ruby-specific tracing table only documents Chat Completion, Responses, and Moderations. https://www.braintrust.dev/docs/integrations/sdk-integrations does not mention Realtime at all.Upstream sources
ruby-openai(alexrudall) README, Realtime/WebRTC section: https://github.com/alexrudall/ruby-openaiBraintrust docs sources checked
Local repo files inspected
lib/braintrust/contrib/openai/patcher.rb— definesChatPatcher,ResponsesPatcher,ModerationsPatcher; no realtime patcherlib/braintrust/contrib/openai/instrumentation/— containschat.rb,responses.rb,moderations.rb,common.rb; norealtime.rblib/braintrust/contrib/ruby_openai/patcher.rbandlib/braintrust/contrib/ruby_openai/instrumentation/— same file set, same gaprealtime/Realtimeacrosslib/braintrust/,test/, andexamples/returns zero matches anywhere in code, tests, or examples (only unrelated cassette filename false-positives)