-
Notifications
You must be signed in to change notification settings - Fork 1
OpenAI: Audio API (client.audio.speech, transcriptions, translations) not instrumented #174
Copy link
Copy link
Open
Open
Copy link
Labels
Description
Summary
wrap_openai() instruments chat.completions, responses, embeddings, moderations, and beta.chat.completions, but does not instrument the Audio API. Calls to client.audio.speech.create(), client.audio.transcriptions.create(), and client.audio.translations.create() silently fall through to the unwrapped OpenAI client via NamedWrapper.__getattr__, producing no Braintrust spans.
Upstream API surface
The OpenAI Audio API includes three stable endpoints:
| Method | Model | Purpose |
|---|---|---|
audio.speech.create() |
tts-1, tts-1-hd, gpt-4o-mini-tts |
Text-to-speech generation |
audio.transcriptions.create() |
whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe |
Speech-to-text transcription |
audio.translations.create() |
whisper-1 |
Audio translation to English |
These are production-stable APIs (not beta), supported in the OpenAI Python SDK via openai.resources.audio.
Why this matters
- Users building voice AI applications with
wrap_openai()get no tracing for audio calls while all their text generation calls are traced. - Transcription and TTS calls have useful metrics (model, duration, response format) that could be captured in spans.
- This is the same class of gap as the Images API (OpenAI: Images API (
client.images.generate()) not instrumented #124) — a stable OpenAI resource thatwrap_openai()silently skips. - The parallel gap in LiteLLM (
transcription(),speech()) is tracked separately in LiteLLM:image_generation(),transcription(),speech(), andrerank()not instrumented #165.
Braintrust docs status
The OpenAI integration docs document wrap_openai() but do not mention Audio API support: not_found.
Local files inspected
py/src/braintrust/oai.py—OpenAIV1Wrapper(line ~955) and_apply_openai_wrapper(line ~1142) wrapchat,responses,embeddings,moderations,betabut notaudiopy/src/braintrust/oai.py—NamedWrapper.__getattr__(line ~20) silently delegates unrecognized attributes to the unwrapped clientpy/src/braintrust/wrappers/test_openai.py— no test cases forclient.audio.*py/noxfile.py— no audio-specific test session
Reactions are currently unavailable