Recipes

Live text to speech

Changed on

Append text to <c>output.inputUrl</c> and play <c>output.audioUrl</c>; billed per character once the session ends.

post/v2/consumer/recipes/liveTextToSpeech

Request

  • The document declares no server URL.
  • Auth: none required

Query parameters

experimentalboolean
allowMatureContentboolean
whatifboolean
ephemeralboolean
tier'paid' | 'free'

How a workflow is paid for.

Request body

enginestring required
textstring nullable

Spoken before any appended text.

languagestring nullable

Target language (e.g., "English", "Chinese"). Defaults to "Auto".

format'pcm' | 'ogg'

pcm streams raw s16le 24 kHz mono for the lowest latency; ogg streams Opus.

maxCharactersinteger

The session ends once this many characters have been spoken. The upfront balance check covers this much text.

idleTimeoutSecondsinteger

The input is treated as closed when no text arrives for this many seconds.

Response

OK

inputUrlstring uri required

POST UTF-8 text here in chunks numbered ?seq=0,1,…, with final=true on the last. Text is spoken a sentence at a time; the final chunk flushes whatever is left.

inputUrlExpiresAtstring date-time required
audioUrlstring uri required

One continuous audio stream for the whole session, in the requested format.

charactersinteger required

Characters spoken so far; the session is billed on this.

audioSecondsnumber double required

Changes