---
title: "Stream speech in a named voice as raw PCM"
method: POST
path: "/v1/tts/{voice_id}/stream"
tags: ["Speech"]
---

# Stream speech in a named voice as raw PCM

`POST /v1/tts/{voice_id}/stream`

## Request

- Base URL: `https://api.kalpalabs.ai`
- URL: `https://api.kalpalabs.ai/v1/tts/{voice_id}/stream`
- Auth: HTTP bearer

Render the given text as speech in one of the named voices from GET /v1/voices, streaming the audio while it is generated, so playback can start after the first ~80 ms instead of after the whole clip. The response body is the audio itself: raw 16-bit little-endian PCM, mono, at `sample_rate` (24 kHz by default), with no header. Each request renders one utterance. The response starts with the first audio, so a request that fails before then gets an ordinary error response with its status code; if generation fails after audio has started, the connection is terminated before the response completes. Closing the connection stops generation.

## Path parameters

- `voice_id` string, required: A named voice id, as listed by GET /v1/voices.

## Request body

- VoiceTtsStreamRequest: Text to speak in a named voice, and the format of the audio streamed back as the response body.
  - `text` string, required: Text to speak; must contain at least one non-whitespace character.
  - `model` string, nullable: Public model id (see GET /v1/models). Omit/null for the default model.
  - `params` GenParamsModel: Generation knobs, all optional — the defaults are the tuned production sampling, shared by every generation endpoint (served with UI ranges at GET /v1/info).
    - `temperature` number
    - `acoustic_temperature` number, nullable: Temperature for the voice's fine acoustic detail; null = follow `temperature`.
    - `audio_quality` 'low' | 'medium' | 'high': Playback fidelity: high = full quality (default); lower tiers reduce fidelity, not payload size.
  - `output_format` 'pcm_s16le': Encoding of the response body: raw 16-bit little-endian PCM, mono, no header.
  - `sample_rate` 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000: Output sample rate in Hz.

## Response `200`

The audio as it is generated: raw 16-bit little-endian PCM, mono, at `sample_rate`.

## Other responses

- `400`: Semantically invalid request.
- `401`: Missing or invalid API key.
- `402`: Your organization's allowance of generated audio is used up or has expired.
- `403`: The organization is suspended.
- `404`: Unknown voice id, or a voice not offered for the requested model.
- `422`: Request validation failed.
- `429`: Rate limit exceeded.
- `500`: Unexpected internal error.
- `502`: The inference backend failed.
- `503`: Temporarily unavailable: the model is overloaded (`overloaded`; retry after `Retry-After`), or API-key verification is down (`service_unavailable`).

## Changes

- **2026-10-21** `f41853b80be7`: 1 warning
  - removed the request property `params/max_new_tokens`
- **2026-10-21** `88068ba536d2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kalpalabs/apis/kalpa-speech-api/changes/v1/tts/:voice_id/stream/post.md)

---

[API](https://skmtc.dev/kalpalabs/apis/kalpa-speech-api.md) - [All operations](https://skmtc.dev/kalpalabs/apis/kalpa-speech-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kalpalabs/apis/kalpa-speech-api/revisions/e01fbbfe1ef3?raw)
