Generate Text-to-Speech

Synthesize speech from a script and get back a hosted audio URL. The returned url can be reused as an audio input in POST /v2/generate to lip sync the synthesized take. voiceId accepts an ElevenLabs voice id (discover via GET /v2/voices) or the id of a voice cloned via POST /v2/voices. Free-tier keys share the monthly ElevenLabs allowance; paid plans are billed per use.

Authentication

x-api-keystring
API Key authentication via header

Request

This endpoint expects an object.
scriptstringRequired
The text to synthesize into speech.
voiceIdstringRequired

A voice id to synthesize with — either an ElevenLabs voice id (discover via GET /v2/voices) or the id of a voice cloned via POST /v2/voices.

providerenumRequired

The voice provider to synthesize with. Currently elevenlabs.

stabilitydoubleOptional

Voice stability (0-1). Higher is more consistent, lower is more expressive.

similarityBoostdoubleOptional

How closely the synthesized audio matches the original voice (0-1).

Response

TTS audio generated successfully
idstring
A unique identifier for the synthesized audio.
urlstring

The hosted URL of the synthesized audio. Reuse it as an audio input in POST /v2/generate to keep the same take across generations.

durationdouble
Duration of the synthesized audio in seconds.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
500
Internal Server Error