Skip to content

feat(speech): accept response_format=ogg as an opus alias - #10822

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.50from
RaviTharuma:feat/10587-ogg-speech-alias
Aug 20, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.50from
RaviTharuma:feat/10587-ogg-speech-alias

Conversation

@RaviTharuma

Copy link
Copy Markdown
Contributor

Summary

  • POST /v1/audio/speech with response_format=ogg was forwarded to OpenAI TTS and returned 400 Invalid response_format.
  • OmniRoute already returns Ogg/Opus bytes for opus. Map ogg → opus on the OpenAI-compat path.
  • Other formats unchanged.

Related Issues

Validation

  • Change type: provider
  • Focused tests: tests/unit/audio-speech-ogg-alias-10587.test.ts (2 pass)
  • npm run lint
  • Reconciled with release/v3.8.50
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/audio-speech-ogg-alias-10587.test.ts

Coverage Notes

  • normalizeSpeechResponseFormat and the default OpenAI-compat JSON body are covered by the new unit file.

Reviewer Notes

  • Content-Type remains whatever the upstream returns for opus (typically audio/opus).

@RaviTharuma

Copy link
Copy Markdown
Contributor Author

E2E on published v3.8.49:

POST /v1/audio/speech model=openai/tts-1 response_format=mp3 → HTTP 200 audio/mpeg (7680 bytes in this probe).

response_format=ogg → HTTP 400 Invalid response_format.

Matches this PR. Not in the published image yet.

No hostnames or keys.

@RaviTharuma
RaviTharuma force-pushed the feat/10587-ogg-speech-alias branch 2 times, most recently from b9211f1 to 7bd674f Compare August 20, 2026 13:04
@RaviTharuma

Copy link
Copy Markdown
Contributor Author

Rebased onto current release/v3.8.50 via #10828 (f5be5dda2). Unique commit replayed on the drain HEAD. Merge is MERGEABLE. Does not merge.

@RaviTharuma
RaviTharuma force-pushed the feat/10587-ogg-speech-alias branch from 7bd674f to a928a2e Compare August 20, 2026 13:54
@RaviTharuma

Copy link
Copy Markdown
Contributor Author

Rebased onto current release/v3.8.50 via #10828 (0a09b6ac0 / 4821f9f). Unique commit replayed. HEAD a928a2e9c. Does not merge.

Voice-note clients send ogg. OpenAI TTS documents opus; OmniRoute already
returns Ogg/Opus bytes for opus. Map ogg to opus before the upstream call.

Fixes #10587
@RaviTharuma
RaviTharuma force-pushed the feat/10587-ogg-speech-alias branch from a928a2e to 13233bb Compare August 20, 2026 13:57
@RaviTharuma

Copy link
Copy Markdown
Contributor Author

Removed the shared #10828 drain commits from this branch so the diff is feature-only again (it had been ~100 files of i18n/catalog/CI dump stacked under the real change). Rebased onto current release/v3.8.50 (4821f9ffd). Does not merge.

@diegosouzapw
diegosouzapw merged commit 6f08a08 into cheaper-inference:release/v3.8.50 Aug 20, 2026
5 checks passed
@RaviTharuma
RaviTharuma deleted the feat/10587-ogg-speech-alias branch September 23, 2026 19:38
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ference#10822)

Merged — validated together with a batch of related RaviTharuma PRs in one combined worktree (typecheck:core clean, complexity/file-size/changelog gates green, focused tests passing). Thanks for the contribution!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(providers): support response_format=ogg in /v1/audio/speech

2 participants