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

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

const voice = await client.voices.create({
  enhance: false,
  files: [fs.createReadStream('path/to/file')],
  name: 'new-voice',
});

console.log(voice.id);
{
  "description": "a newly created voice",
  "gender": "male",
  "id": "123456789abcdef",
  "name": "new-voice",
  "owner": "me",
  "starred": false,
  "state": "ready",
  "type": "instant"
}

Authorizations

X-API-Key
string
header
required

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

Body

multipart/form-data
name
string
required

The display name for this voice

Example:

"new-voice"

enhance
boolean
required

For unclean audio with background noise, applies processing to attempt to improve quality. Default is false as this can also degrade quality in some circumstances.

Example:

false

files
file[]
required

One or more input audio files to train the voice in the form of binary wav, mp3, mp4, m4a, or webm attachments.

  • Max attached files: 20.
  • Max total file size: 250 MB.
Required array length: 1 - 20 elements
Example:

"@/Users/user/file.wav"

gender
string

A tag describing the gender of this voice. Has no effect on voice creation.

description
string

A text description of this voice.

Response

OK

Voice details

id
string
required

The unique identifier of this voice.

name
string
required

The display name of this voice.

owner
enum<string>
required

The owner of this voice.

Available options:
system,
me,
other
state
string
required

The state of this voice in the training pipeline (e.g., ready, training).

description
string | null

A text description of this voice.

gender
string

A tag describing the gender of this voice, e.g. male, female, nonbinary.

starred
boolean

Whether this voice has been starred by you or not.

type
enum<string>

The method by which this voice was created: instant or professional.

Available options:
instant,
professional
preview_url
string

A URL that returns a preview speech sample of this voice. The file can be played directly in a browser or audio player.