v1

latestOpenAPI 3.1.02026-07-13212942.9 KB
Synchronous

Sync Text To Speech With Signed Url Output

Synthesise speech and return a short-lived GCS signed URL to the audio file.

Calls :func:sync_text_to_speech internally, uploads the resulting audio to the configured GCS bucket, generates a signed download URL (TTL controlled by GENERIC.sync_tts_results_expiration_time_minutes), and returns it.

Args: tts_request: TTS parameters (text, voice, model, output format, etc.). background_tasks: FastAPI background-task queue used for temp-file cleanup. token_service: Injected token validation service. _request: Raw FastAPI Request used for rate-limiting. x_api_key: Bearer API key from the x-api-key header. version: API version extracted from the version request header. tts_service_stub: gRPC stub connected to the XCODEC synthesis server.

Returns: SyncTTSWithSUAudioResponse: Signed GCS URL pointing to the synthesised audio.

Raises: Exception: Re-raises any error that occurs during GCS upload or URL generation.

post/text_to_speech/with_signed_url_output

Headers

version'v1'
X-Api-Keystring

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

signed_urlstring required

Signed URL to access the generated audio file

Example response

{
  "signed_url": "https://storage.googleapis.com/bucket_name/audio_file.wav"
}