Details

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.

Issues

Resolves #2202 /claim #2202

Testing

  • Python integration tests: test_openai_speech.py verify sync & streaming paths.
  • Java unit tests: CostServiceTest.java check character-based cost computation.
  • All existing suites run green.

Documentation

Primary guide updated at apps/opik-documentation/documentation/fern/docs/tracing/integrations/openai.mdx, including examples and cost tables for TTS.

Claim

Total prize pool $200
Total paid $0
Status Pending
Submitted July 25, 2025
Last updated July 25, 2025

Contributors

VL

Vladimir Rotariu

@vladimirrotariu

100%

Sponsors

CO

Comet

@comet-ml

$200