---
title: "Generate speech"
method: POST
path: "/v1/text-to-speech"
---

# Generate speech

`POST /v1/text-to-speech`

## Request

- Base URL: `https://giggy.ai`
- URL: `https://giggy.ai/v1/text-to-speech`
- Auth: API key in header `xi-api-key`

Batch and Fast return the canonical MP3 response. Streaming returns progressive audio/pcm (pcm_24000) only.

## Query parameters

- `optimize_streaming_latency` integer, nullable

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `text` string, required: Supported Unicode speech text. Fast and Streaming accept up to 20,000 Unicode code points; Batch accepts up to 1,250. Emoji are not accepted.
  - `voice_id` string, uuid, required: A voice_id returned by /v1/voices or /v1/my-voices.
  - `model_id` string: Accepted for compatibility only; it does not select or otherwise affect GiggySpeech inference.
  - `mode` 'batch' | 'fast' | 'streaming': Selects Batch, Fast, or Streaming generation. Defaults to Fast when omitted.
  - `output_format` 'mp3_24000_160' | 'pcm_24000': Streaming defaults to pcm_24000 and accepts only PCM16 LE, 24 kHz mono. Fast and Batch default to mp3_24000_160 and accept only MP3.
  - `voice_settings` object, nullable: Only speed affects GiggySpeech inference. The remaining settings are accepted for compatibility only.
    - `stability` number
    - `similarity_boost` number
    - `style` number
    - `use_speaker_boost` boolean
    - `speed` number
  - `language_code` string, nullable: Must match the selected voice language; it does not override that language.
  - `pronunciation_dictionary_locators` object[], nullable: Accepted for compatibility only; it has no effect on GiggySpeech inference.
  - `seed` integer, nullable: If omitted or null, the server selects a seed for this generation. Retries with the same Idempotency-Key retain the same seed.
  - `previous_text` string, nullable: Accepted for compatibility only; it has no effect on GiggySpeech inference.
  - `next_text` string, nullable: Accepted for compatibility only; it has no effect on GiggySpeech inference.
  - `previous_request_ids` string[], nullable: Accepted for compatibility only; it has no effect on GiggySpeech inference.
  - `next_request_ids` string[], nullable: Accepted for compatibility only; it has no effect on GiggySpeech inference.
  - `apply_text_normalization` 'auto' | 'on' | 'off': Accepted for compatibility only; it has no effect on GiggySpeech inference.
  - `apply_language_text_normalization` boolean: Accepted for compatibility only; it has no effect on GiggySpeech inference.
  - `use_pvc_as_ivc` boolean: Accepted for compatibility only; it has no effect on GiggySpeech inference.

## Response `200`

Batch and Fast return completed audio/mpeg. Streaming returns progressive audio/pcm only.

## Other responses

- `400`: Malformed JSON or malformed request identifier.
- `401`: Missing or invalid API key
- `402`: Available credits, automatic recharge, or an account or key credit budget prevents generation
- `404`: Voice unavailable to this account
- `409`: Idempotency key reused with different request parameters
- `422`: Invalid request
- `429`: Rate limit exceeded
- `500`: Server error
- `503`: Required API service unavailable
- `504`: Generation did not finish within the synchronous request window

---

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