Passer à la navigation

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.

Authentification

x-api-keystring
Authentification par clé API via en-tête

En-têtes

Idempotency-KeystringOptionnel

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.

Requête

This endpoint expects an object.
scriptstringRequis1-5000 characters

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

voiceIdstringRequis

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.

providerenumRequis

The voice provider to synthesize with. Currently elevenlabs.

Valeurs autorisées:
stabilitydoubleOptionnel0-1

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

similarityBoostdoubleOptionnel0-1

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

Réponse

Job accepted successfully.
idstring
Unique identifier for the job.
statusenum
The current lifecycle status of the job.
Valeurs autorisées:
createdAtdatetime
When the job was created.
urlstringOptionnel
The hosted URL of the synthesized audio. Null unless status is SUCCESS.
durationdoubleOptionnel
Duration of the synthesized audio in seconds. Null unless status is SUCCESS.
errorobjectOptionnel
Error detail. Null unless status is FAILED.
startedAtdatetimeOptionnel
When synthesis started. Null until synthesis starts.
finishedAtdatetimeOptionnel
When the job reached a terminal state. Null until the job is SUCCESS or FAILED.

Erreurs

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