Multi-speaker Speech
/v1/audio/speech/speakersGenerate multi-speaker dialogue by defining speakers, voices, and text segments.
Request parameters
Model ID. Use the stable model ID for regular calls, or a snapshot model ID when you need to reproduce results from a fixed version.
When set to true, creates an asynchronous task and immediately returns a task object. Query the task for its result; webhook_url is only used for terminal-state notifications.
The HTTPS URL called back after the asynchronous task completes.
The speaker configuration array, declaring each speaker and its voice; cannot be empty.
The speaker identifier, referenced by segments[].speaker.
The speaker's voice ID; obtainable from the List Voices or Create Voice endpoint.
The segment array, giving the lines per speaker; cannot be empty.
The speaker identifier; must match one of speakers[].id.
The text of this line.
Audio format for synchronous requests. Asynchronous tasks may not honor this field; use the format returned by the task query as the source of truth.
Result delivery method.
Controls whether an invisible AIGC marker is written to the generated audio file. It is not written by default. This field affects only the metadata of the final audio file, not the synthesized speech content.
Whether to write an invisible AIGC marker. Defaults to false.
The name or code of the content distribution service provider.
The content distribution ID used to identify this distribution.
Return value
When async=true is provided, the endpoint immediately returns an asynchronous task object. Use the returned task_id to query the result with GET /v1/audio/tasks/{task_id}.
Without asynchronous mode, delivery_method=url returns JSON containing an audio URL. When delivery_method=audio or the field is omitted, the endpoint returns audio binary data directly; the response header Content-Type determines its format.
Error codes
| HTTP | error.code | Trigger | Suggested action |
|---|---|---|---|
| 404 | voice_not_found | A speakers[].voice_id does not exist or is unavailable | Verify each speakers[].voice_id. |