v1

latestOpenAPI 3.1.02026-07-13212942.9 KB
Streaming

Stream Text To Speech Playground

Internal playground endpoint for streaming TTS — not shown in the public schema.

Reads the API key from the PLAYGROUND_API_KEY environment variable and delegates to :func:stream_text_to_speech. Rate-limited independently via the RATELIMIT.PLAYGROUND config section.

Args: tts_request: TTS parameters (text, voice, model, format, etc.). background_tasks: FastAPI background-task queue. _request: Raw FastAPI Request object used for rate-limiting and app.state access. rl: Playground-specific rate-limiter dependency.

Returns: StreamingResponse: SSE stream of audio chunks (same as the main endpoint).

Raises: Exception: If PLAYGROUND_API_KEY is not configured.

post/text_to_speech/streaming/hidden/playground

Request body

model_id'async_flash_v1.0' | 'async_flash_v1.5' | 'async_pro_v1.0'
normalizeboolean

Whether to normalize the input text. If False, the input text will be used as is.

experimental_streaming_modeboolean

Whether to stream audio in experimental mode.

experimental_stp_v2boolean

Use v2 STP prompt format (pr_speech_start/end). Only has effect when experimental_streaming_mode=True.

transcriptstring required
previous_request_idstring uuid nullable

ID returned in the X-Request-Id header of a previous TTS response. When provided, the last sentence of that request is appended AFTER the voice reference, enabling voice continuity across requests. Effective only for STP-based models (async_flash_v1.5, async_pro_v1.0). Silently falls back to the voice reference alone when the entry has expired, is missing, or belongs to a different token / voice / model / experimental_stp_v2 setting.

language'en' | 'fr' | 'it' | 'de' | 'es' | 'pt' | 'ar' | 'ru' | 'ro' | 'ja' | 'he' | 'hy' | 'tr' | 'hi' | 'zh' | 'cmn' | 'ur'
lang_detection_mode'llm' | 'fasttext'
sentence_splitter_chunk_sizeinteger nullable

Number of characters to split the transcript into chunks. None if based on sentences.

durationnumber nullable
stabilityinteger

TTS's stability.

speed_controlnumber

TTS's speed control.

Example request

{
  "transcript": "Hello, world!"
}

Response

Successful Response

{"stackTrail":"paths:/text_to_speech/streaming/hidden/playground:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}