Files
Palash Debnath 039e8fa11d feat(api): ElevenLabs-compatible API under /elevenlabs (#4467)
* feat(api): ElevenLabs-compatible API under /elevenlabs

Apps and SDKs built for ElevenLabs work with VoiceStudio by changing the
base URL. Text to speech (whole and streamed, mp3/opus/wav/pcm/ulaw/alaw at
the requested rate), speech to text with ElevenLabs word items, voices,
default voice settings and models, mapped onto the OpenAI-compatible
handlers so routing, licence gates, pronunciation and the watermark are
shared. xi-api-key is accepted as the API key on /elevenlabs routes only.

* docs(changelog): ElevenLabs-compatible API (#4467)

* feat(api): ElevenLabs voice changer and sound effects routes

* feat(api): ElevenLabs speaker labels and voice isolation

* style: drop unused imports

* feat(integrations): ElevenLabs Python SDK snippet on the VoiceStudio API page

* docs(structure): 47 routers

* fix(api): review findings on the ElevenLabs-compatible API (#4467)

- mp3/opus/wav deliver the rate and bitrate output_format names; other
  combinations are a 422
- audio routes declare audio, not JSON, in the API contract
- isolation never starts a Demucs weight download: it needs the model
  cached by an in-app separation first
- transcription uploads (OpenAI and ElevenLabs routes) stream to disk in
  chunks under a 2 GB cap instead of a whole-file read; the temp file no
  longer leaks when reading fails
- upload writes leave the event loop; isolation cleans up if its work dir
  cannot be created
- the ElevenLabs snippet sends no placeholder key
- no traceback in the model-list warning

* fix(api): ElevenLabs API review findings and CI (#4467)

- Route both WAV writes through the audited _safe_soundfile_write helper.
- Accept only MP3 bitrates libmp3lame encodes exactly for the rate (MPEG-1
  at 32 kHz and above, MPEG-2/2.5 below); list the six PCM rates in the docs.
- Remove the staged upload when cancellation interrupts a transcription
  upload, and keep the cancellation.
- Close the diarization copy through an ExitStack; explain best-effort
  unlink excepts.
- The local OpenAI snippet reads OMNIVOICE_API_KEY like the ElevenLabs one,
  so a Docker backend on 127.0.0.1 accepts it.
- The nested-ASR owner test's fake upload reads in chunks like the route.

* fix(elevenlabs): close review findings on the compat API

- pcm_32000, the SDK's /v1/voice-changer path and /stream forms are served
- voice isolation accepts Demucs 4.1's Hugging Face cache and runs Demucs
  offline, so the request never downloads a model
- the voice changer refuses video, whose swap path can fetch a model
- oversized uploads are refused while they arrive, before multipart spooling
- staged uploads close off the event loop after a cancelled write, and an
  abandoned diarization worker keeps its audio until it lets go
- Opus is encoded at a constant bitrate; MP3 tests read frame headers

* test(api): record the ElevenLabs voice-changer routes in the route inventory

* chore(licensing): record the Hugging Face htdemucs weights voice isolation checks for
2026-11-25 22:24:16 +05:30
..