v1

latestOpenAPI 3.1.02026-08-06143234.8 KB
textToSpeech

Synthesize Speech

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

post/v1/speech/generate

Headers

api-keystring

Request body

audioDurationnumber 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.

channelTypestring

Valid values: STEREO, MONO

encodeAsBase64boolean

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.

formatstring

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.

multiNativeLocalestring

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.

localestring

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.

pitchinteger

Pitch of the voiceover

rateinteger

Speed of the voiceover

sampleRatenumber double

Valid values are 8000, 24000, 44100, 48000

stylestring

The voice style to be used for voiceover generation.

textstring required

The text that is to be synthesised. e.g. 'Hello there [pause 1s] friend'

variationinteger

Higher values will add more variation in terms of Pause, Pitch, and Speed to the voice. Only available for Gen2 model.

voiceIdstring 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).

wordDurationsAsOriginalTextboolean

If set to true, the word durations in response will return words as the original input text. (English only)

Response

Ok

audioFilestring url required
audioLengthInSecondsnumber double required
consumedCharacterCountinteger

Number of characters consumed so far in the current billing cycle.

encodedAudiostring
remainingCharacterCountinteger required

Remaining number of characters available for synthesis in the current billing cycle.

warningstring