---
title: "Generate speech"
method: POST
path: "/generate-speech"
---

# Generate speech

`POST /generate-speech`

## Request

- Base URL: `https://api.lazybird.app/v1`
- URL: `https://api.lazybird.app/v1/generate-speech`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in query parameter `api_key`

Generates speech with the selected voice and returns an MP3 file. Provide either `text` or `ssml`. Save the response body to a file.

## Request body

- GenerateSpeechRequest
  - `voiceId` string, required: Voice `id` from GET /voices
  - `text` string: Plain text to speak
  - `ssml` string: SSML (use instead of `text` for pauses or markup)
  - `settings` VoiceSettings: All fields optional
    - `style` string: Speaking style from the voice's `styleList`
    - `styleIntensity` number: Strength of the style
    - `speed` number: 1 is normal speed
    - `pitch` number: 1 is the default pitch
    - `volume` number: 1 is the default volume
    - `locale` string: BCP-47 locale override for multilingual and cloned voices, e.g. `es-ES`

## Response `200`

MP3 audio

## Other responses

- `400`: Invalid input
- `401`: Missing or invalid API key
- `422`: Plan limit reached (credits, voice slots or plan feature)
- `429`: Too many requests; retry after `Retry-After` seconds
- `500`: Server error

---

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