Introduces end-to-end support for OpenAI Text-to-Speech (TTS):
Python SDK
openai_speech_decorator.py
+ speech_stream_buffer.py
+ speech_stream_events_aggregator.py
– trace audio.speech
requests (sync & streaming) and aggregate stream chunks.opik_tracker.py
& stream_patchers.py
patched to hook the new decorator and process chunks.openai_speech_usage.py
model records per-character usage for cost analytics.Java backend
ModelPrice.java
, SpanCostCalculator.java
, CostService.java
extended with inputCharacterPrice
and new speechTtsCost
calculator to bill TTS spans by character.Front-end
TracesSpansTab.tsx
adds a Chars column, surfacing character_count
and tying it into existing cost display.Documentation
openai.mdx
updated with TTS tracing instructions, environment setup, and pricing explanation.Resolves #2202 /claim #2202
test_openai_speech.py
verify sync & streaming paths.CostServiceTest.java
check character-based cost computation.Primary guide updated at apps/opik-documentation/documentation/fern/docs/tracing/integrations/openai.mdx
, including examples and cost tables for TTS.
Vladimir Rotariu
@vladimirrotariu
Comet
@comet-ml