---
title: "Synthesize Speech"
method: POST
path: "/v1/speech/generate"
tags: ["textToSpeech"]
---

# Synthesize Speech

`POST /v1/speech/generate`

Returns a url to the generated audio file along with other associated properties.

## Headers

- `api-key` string

## Request body

- GenerateSpeechRequest
  - `audioDuration` number, double — This parameter allows specifying the duration (in seconds) for the generated audio. If the value is 0, this parameter will be ignored. Only available for Gen2 model.
  - `channelType` string — Valid values: STEREO, MONO
  - `encodeAsBase64` boolean — Set to true to receive audio in response as a Base64 encoded string instead of a url. This enables zero retention of audio data on Murf's servers.
  - `format` string — Format of the generated audio file. Valid values: MP3, WAV, FLAC, ALAW, ULAW, PCM, OGG
  - `modelVersion` 'GEN2' — Valid values: GEN2. Audio will be generated using the new and advanced GEN2 model. Outputs from GEN2 sound more natural and high-quality compared to earlier models.
  - `multiNativeLocale` string — This field is superseded by `locale` field. Please migrate to `locale` field to ensure compatibility with future API versions. Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model. Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speech/voices endpoint to retrieve the list of available voices and languages.
  - `locale` string — Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model. Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speech/voices endpoint to retrieve the list of available voices and languages.
  - `pitch` integer — Pitch of the voiceover
  - `rate` integer — Speed of the voiceover
  - `sampleRate` number, double — Valid values are 8000, 24000, 44100, 48000
  - `style` string — The voice style to be used for voiceover generation.
  - `text` string, required — The text that is to be synthesised. e.g. 'Hello there [pause 1s] friend'
  - `variation` integer — Higher values will add more variation in terms of Pause, Pitch, and Speed to the voice. Only available for Gen2 model.
  - `voiceId` string, required — Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
  - `wordDurationsAsOriginalText` boolean — If set to true, the word durations in response will return words as the original input text. (English only)

## Response `200`

Ok

- GenerateSpeechResponse
  - `audioFile` string, url, required
  - `audioLengthInSeconds` number, double, required
  - `consumedCharacterCount` integer — Number of characters consumed so far in the current billing cycle.
  - `encodedAudio` string
  - `remainingCharacterCount` integer, required — Remaining number of characters available for synthesis in the current billing cycle.
  - `warning` string
  - `wordDurations` WordDurationResponse[], required
    - `endMs` integer
    - `pitchScaleMaximum` number, double — This field has been deprecated.
    - `pitchScaleMinimum` number, double — This field has been deprecated.
    - `sourceWordIndex` integer — This field has been deprecated.
    - `startMs` integer
    - `word` string

## Other responses

- `400` — Bad Request
- `402` — Expired subscription or character limit exhausted
- `403` — Invalid or expired token/api-key provided
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/murf/apis/api-reference.md) · [All operations](https://skmtc.net/murf/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/murf/api-reference/revisions/07a6cdc0774e/schema)
