POST
/
v1
/
ai
/
speech
JavaScript
import Lmnt from 'lmnt-node';

const client = new Lmnt({
  apiKey: 'My API Key',
});

const response = await client.speech.generateDetailed({ text: 'hello world.', voice: 'leah' });

console.log(response.audio);
{
  "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.mp3The 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.