Zur Navigation springen

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.

Authentifizierung

x-api-keystring
API-Key-Authentifizierung via Header

Header

Idempotency-KeystringOptional

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.

Anfrage

This endpoint expects an object.
scriptstringErforderlich1-5000 characters

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

voiceIdstringErforderlich

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.

providerenumErforderlich

The voice provider to synthesize with. Currently elevenlabs.

Erlaubte Werte:
stabilitydoubleOptional0-1

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

similarityBoostdoubleOptional0-1

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

Antwort

Job accepted successfully.
idstring
Unique identifier for the job.
statusenum
The current lifecycle status of the job.
Erlaubte Werte:
createdAtdatetime
When the job was created.
urlstringOptional
The hosted URL of the synthesized audio. Null unless status is SUCCESS.
durationdoubleOptional
Duration of the synthesized audio in seconds. Null unless status is SUCCESS.
errorobjectOptional
Error detail. Null unless status is FAILED.
startedAtdatetimeOptional
When synthesis started. Null until synthesis starts.
finishedAtdatetimeOptional
When the job reached a terminal state. Null until the job is SUCCESS or FAILED.

Fehler

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