POSThttps://api.breeze.blue/v1/text-to-speech/{voice_id}/stream

Stream text to speech

Stream synthesized audio as it is generated.

Authentication

API key: Send your Breeze Developer API key with the xi-api-key header.

Headers

FieldTypeDescription
xi-api-keyrequiredstringYour Breeze Developer API key. See authentication.
content-typerequiredstringapplication/json

Path parameters

FieldTypeDescription
voice_idrequiredstringVoice identifier to synthesize. Use GET /v1/voices to discover available IDs.

Query parameters

FieldTypeDescription
output_formatstring
default: mp3
Streaming output encoding. Supported values: mp3, pcm. Default: mp3.

Request body

FieldTypeDescription
textrequiredstringText to synthesize.
model_idstringmodel_id request field for TtsRequest.
language_codestringlanguage_code request field for TtsRequest.
instructionsstringinstructions request field for TtsRequest.
voice_settingsobjectvoice_settings request field for TtsRequest.
voice_settings.guidance_scalenumbervoice_settings.guidance_scale request field for VoiceSettingsPayload.

Example request

python from breeze_blue import stream import os from breeze_blue import BreezeBlue client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"]) audio = client.text_to_speech.stream( voice_id="voc_xeh3w54cqvnp", text="Streaming preview from Breeze Blue.", model_id="bluebell-v1-en", voice_settings={"guidance_scale": 1.2}, ) stream(audio) typescript import { stream } from "@breeze.blue/sdk/node"; import { BreezeBlueClient } from "@breeze.blue/sdk"; const client = new BreezeBlueClient({ apiKey: process.env.BREEZE_API_KEY!, }); const audio = await client.textToSpeech.stream( "voc_xeh3w54cqvnp", { text: "Streaming preview from Breeze Blue.", modelId: "bluebell-v1-en", voiceSettings: { guidanceScale: 1.2 }, }, ); await stream(audio); curl curl -X POST "https://api.breeze.blue/v1/text-to-speech/voc_xeh3w54cqvnp/stream" \ -H "xi-api-key: $BREEZE_API_KEY" \ -H "content-type: application/json" \ --data '{ "model_id": "bluebell-v1-en", "text": "Streaming preview from Breeze Blue.", "voice_settings": { "guidance_scale": 1.2 } }'
from breeze_blue import stream

import os

from breeze_blue import BreezeBlue

client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])

audio = client.text_to_speech.stream(
    voice_id="voc_xeh3w54cqvnp",
    text="Streaming preview from Breeze Blue.",
    model_id="bluebell-v1-en",
    voice_settings={"guidance_scale": 1.2},
)
stream(audio)

Response

Streaming audio bytes. The history-item-id header identifies the persisted generation.

Content types: audio/mpeg, audio/pcm

Response headers:

  • history-item-id: History item ID for the generated audio.
  • x-breeze-api-key-id: Public API key identifier used to authenticate the request, when an API key was used.
Binary audio/mpeg, audio/pcm response body

Errors

  • VALIDATION_ERRORThe request body failed schema validation.
  • BAD_REQUESTThe request body or query parameter is not valid for this endpoint.
  • RESOURCE_NOT_FOUNDThe voice_id does not exist or is not accessible.
  • GENERATION_CONCURRENCY_EXCEEDEDYour plan's concurrent generation limit was reached. Please retry shortly.
  • GENERATION_CAPACITY_EXCEEDEDGeneration capacity is temporarily exhausted.
  • UPSTREAM_GENERATION_ERRORThe downstream generation service failed.
  • UPSTREAM_TIMEOUTThe downstream generation service timed out.

See the full list on errors.

Notes

  • Use voice_settings.guidance_scale to adjust how strongly generation follows the prompt and reference voice.