Single-speaker Speech
/v1/audio/speechGenerate speech from text with a voice_id, using non-streaming output, raw PCM, or SSE.
Request parameters
Model ID. Use a stable model ID by default; use a snapshot model ID when you need to reproduce results from a fixed version.
Text to synthesize. Only moss-tts-1.5-flash supports inserting pauses with [pause 0.1s] through [pause 10.0s]; moss-tts-1.0-pro does not support this syntax.
Voice ID; get one via List Voices, or go to the Mossland voice library and copy it from a voice card's copy icon. TTS accepts only a voice ID and does not support voice_url / voice_data, nor inline or reference audio.
Only moss-tts-1.5-flash supports this field. Specify the pronunciation language of the target text; this does not translate the text. For cross-language voice cloning, choose the language of the target text. Use the full English name of a supported language, such as Chinese or English; language codes such as zh and en are not supported. If omitted, the model detects the language automatically.
Desired audio duration in seconds; when provided, it must be greater than 0.
Set to true for streaming output. It cannot be combined with async=true or a non-empty webhook_url.
Output audio format. Streaming requests must use pcm; non-streaming requests can use other formats. For asynchronous tasks, use the task-query result as the authority.
Delivery mode for non-streaming results. By default, the endpoint returns binary audio directly. Do not send this field for streaming requests.
Applies only when stream=true and defaults to audio. Expand to view the two streaming response protocols.
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 to call back once the asynchronous task completes.
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
Depending on how the endpoint is called, it returns audio content, JSON containing an audio URL, or an asynchronous task object. With streaming enabled, it returns an audio data stream or an SSE event stream.
Error codes
The specified voice_id does not exist or is unavailable. Verify that voice_id comes from List Voices, Create Voice, or the Mossland voice library.
Streaming is combined with an unsupported model, field, or option.