POST
/
v1
/
ai
/
speech
curl --request POST \
  --url https://api.lmnt.com/v1/ai/speech \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "voice": "ava",
  "text": "hello world.",
  "model": "aurora",
  "language": "auto",
  "format": "mp3",
  "sample_rate": 24000,
  "speed": 1,
  "seed": 123,
  "conversational": false,
  "length": 123,
  "top_p": 1,
  "temperature": 1,
  "return_durations": true
}'
{
  "audio": "<string>",
  "durations": [
    {
      "text": "<string>",
      "duration": 123,
      "start": 123
    }
  ],
  "seed": 123
}

The output of this POST request is a JSON object from which you must extract and decode the base64-encoded audio data. Here is an example of how to do so in your terminal:

jq -r '.audio' lmnt-output.json | base64 --decode > lmnt-audio-output.mp3

The file format of your audio output depends on the format specified in the inital request (this example assumes format=mp3).

Authorizations

X-API-Key
string
header
required

Your API key; get it from your LMNT account page.

Body

application/json

Response

200
application/json
OK

The response is of type object.