SpeechRequest (openai_compat.py)

VoiceStudio · voice, openai-compat, tts-api, stt-api, api-shim, drop-in-replacement

OpenAI-compatible TTS & STT API — Phase 3.2 (ROADMAP.md P0). Drop-in replacement for OpenAI's audio endpoints so that any tool speaking the OpenAI protocol (Claude, Cursor, LangChain, litellm, etc.) can use VoiceStudio as a local backend with zero code changes. Endpoints ────────

"""
OpenAI-compatible TTS & STT API — Phase 3.2 (ROADMAP.md P0).

Drop-in replacement for OpenAI's audio endpoints so that any tool speaking the
OpenAI protocol (Claude, Cursor, LangChain, litellm, etc.) can use VoiceStudio
as a local backend with zero code changes.

Endpoints
─────────
    POST /v1/audio/speech          → TTS  (text → wav/mp3/opus/flac)
    POST /v1/audio/transcriptions  → STT  (audio file → text/json)
    GET  /v1/audio/voices          → list available voices (VoiceStudio extension)

The router delegates to the active TTS/ASR backends via the same adapter
protocol used by the rest of VoiceStudio, so engine selection, GPU offloading,
model loading, and invisible provenance watermarking (services.watermark,
#1169) all work identically.

Reference: https://platform.openai.c

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key