Saltar a la navegación

Submit Text-to-Speech Job

Submit a job for asynchronous speech synthesis. Returns 202 with the accepted job and a Location header pointing at GET /v2/tts/jobs/{id}; poll that endpoint for the result. Accepts the same body as POST /v2/tts. API-key requests require your organization to be enabled for the asynchronous TTS rollout; otherwise the request returns 503.

Autenticación

x-api-keystring
Autenticación con clave API vía encabezado

Encabezados

Idempotency-KeystringOpcional

Optional idempotency key, 1–128 characters after trimming. Reusing the same key within your organization returns the original job; reusing it with a different request body returns 409.

Solicitud

This endpoint expects an object.
scriptstringRequerido1-5000 characters

The text to synthesize into speech (1–5,000 characters).

voiceIdstringRequerido

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.

providerenumRequerido

The voice provider to synthesize with. Currently elevenlabs.

Valores permitidos:
stabilitydoubleOpcional0-1

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

similarityBoostdoubleOpcional0-1

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

Respuesta

Job accepted successfully.
idstring
Unique identifier for the job.
statusenum
The current lifecycle status of the job.
Valores permitidos:
createdAtdatetime
When the job was created.
urlstringOpcional
The hosted URL of the synthesized audio. Null unless status is SUCCESS.
durationdoubleOpcional
Duration of the synthesized audio in seconds. Null unless status is SUCCESS.
errorobjectOpcional
Error detail. Null unless status is FAILED.
startedAtdatetimeOpcional
When synthesis started. Null until synthesis starts.
finishedAtdatetimeOpcional
When the job reached a terminal state. Null until the job is SUCCESS or FAILED.

Errores

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
409
Conflict Error
422
Unprocessable Entity Error
503
Service Unavailable Error