Skip to main content
POST
/
v1
/
ai
/
speech
/
bytes
JavaScript
import Lmnt from 'lmnt-node';

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

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

console.log(response);

const content = await response.blob();
console.log(content);
This response does not have an example.
Want to stream timestamps with your speech? Check out the streaming WebSocket endpoint and examples using the SDKs in the synchronizing timing guide.

Authorizations

X-API-Key
string
header
required

Body

application/json
voice
string
required
Example:
text
string
required
Example:
model
enum<string>
default:blizzard
Available options:
blizzard
language
enum<string>
default:auto
Available options:
auto,
ar,
de,
en,
es,
fr,
hi,
id,
it,
ja,
ko,
nl,
pl,
pt,
ru,
sv,
th,
tr,
uk,
ur,
vi,
zh
format
enum<string>
default:mp3
Available options:
aac,
mp3,
ulaw,
wav,
webm,
pcm_s16le,
pcm_f32le
sample_rate
enum<number>
default:24000
Available options:
8000,
16000,
24000
seed
integer
debug
boolean
default:false
top_p
number
default:0.8
Required range: 0 <= x <= 1
temperature
number
default:1
Required range: x >= 0

Response