v1
latestOpenAPI 3.1.02026-07-13212942.9 KBSync Text To Speech With Timestamps
Synthesise speech and return audio with per-word alignment timestamps.
Resolves the voice preset, validates quota, then calls the versioned gRPC handler with include_durations=True. Returns a TTSAudioResponse containing base64-encoded audio and character-level start/end times in milliseconds.
Args: tts_request: TTS parameters (text, voice, model, output format, etc.). 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: TTSAudioResponse: Base64-encoded audio and word-level alignment data.
Raises: NotSupportedModel: When the requested model does not support the voice. VoiceNotFound: When the voice preset cannot be resolved. UsageLimitExceeded: When the token has exhausted its quota.
Headers
Request body
Example request
{
"transcript": "Hello, world!"
}Response
Successful Response