Skip to navigation

Stream Input

Generate emotionally expressive speech.

Handshake

WSS
wss://api.hume.ai/v0/tts/stream/input

Query parameters

access_tokenstringOptionalDefaults to

Access token used for authenticating the client. If not provided, an api_key must be provided to authenticate.

The access token is generated using both an API key and a Secret key, which provides an additional layer of security compared to using just an API key.

For more details, refer to the Authentication Strategies Guide.

context_generation_idstringOptional
The ID of a prior TTS generation to use as context for generating consistent speech style and prosody across multiple requests. Including context may increase audio generation times.
format_typeenumOptional
The format to be used for audio generation.
FormatTypeenumRequired
Allowed values:
include_timestamp_typeslist of enumsOptionalDefaults to []
The set of timestamp types to include in the response. Only supported for Octave 2 requests.
Allowed values:
instant_modebooleanOptionalDefaults to true

Enables ultra-low latency streaming, significantly reducing the time until the first audio chunk is received. Recommended for real-time applications requiring immediate audio playback. For further details, see our documentation on instant mode.

no_binarybooleanOptionalDefaults to false
If enabled, no binary websocket messages will be sent to the client.
strip_headersbooleanOptionalDefaults to false

If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk’s audio will be its own audio file, each with its own headers (if applicable).

temperaturedoubleOptional

Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.

This is an experimental parameter. It is recommended to use the default values for most use cases.

Defaults when omitted:

  • Octave 1 voice creation (no voice specified): 0.9
  • Octave 1 text-to-speech: 0.8
  • Octave 2 text-to-speech: 0.75
versionenumOptional
The version of the Octave Model to use. 1 for the legacy model, 2 for the new model.
OctaveVersionenumRequired

Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.

Use 2 to opt into the latest Octave capabilities. When you specify version 2, you must also provide a voice. Requests that set version: 2 without a voice will be rejected.

For a comparison of Octave versions, see the Octave versions section in the TTS overview.

Allowed values:
api_keystringOptionalDefaults to

API key used for authenticating the client. If not provided, an access_token must be provided to authenticate.

For more details, refer to the Authentication Strategies Guide.

Send

InputMessageobjectRequired
Input message type for the TTS stream.
closebooleanOptionalDefaults to false
Force the generation of audio and close the stream.
descriptionstring or nullOptional<=1000 characters

Natural language instructions describing how the synthesized speech should sound, including but not limited to tone, intonation, pacing, and accent.

This field behaves differently depending on whether a voice is specified:

  • Voice specified: the description will serve as acting directions for delivery. Keep directions concise—100 characters or fewer—for best results. See our guide on acting instructions.
  • Voice not specified: the description will serve as a voice prompt for generating a voice. See our prompting guide for design tips.
flushbooleanOptionalDefaults to false
Force the generation of audio regardless of how much text has been supplied.
speeddoubleOptional0.25-3Defaults to 1
Speed multiplier for the synthesized speech. Extreme values below 0.75 and above 1.5 may sometimes cause instability to the generated output.
textstringOptional<=5000 charactersDefaults to
The input text to be synthesized into speech.
trailing_silencedoubleOptional0-5Defaults to 0

Duration of trailing silence (in seconds) to add to this utterance

voiceobject or nullOptional

The name or id associated with a Voice from the Voice Library to be used as the speaker for this and all subsequent utterances, until the voice field is updated again.

See our voices guide for more details on generating and specifying Voices.

Receive

TtsOutputobjectRequired
Output message type for the TTS stream.
audioobjectRequired
Metadata for a chunk of generated audio.
OR
timestampobjectRequired
A word or phoneme level timestamp for the generated audio.