Generate speech
Synthesize audio from text.
/model/v1/audio/speech● SupportedRequest body
modelstring必填Speech model id, for example `melotts` or `aura-2-en`; list candidates with listModels?type=speech. Router support (supported): Verified to take effect.
Verified to take effect.
inputstring可选Text to synthesize, 1 to 4096 characters. `text` and `prompt` are aliases; when several are given, `input` wins. Router support (supported): melotts supports input, lang and response_format=wav; text/prompt aliases also work.
melotts supports input, lang and response_format=wav; text/prompt aliases also work.
response_formatstring可选◐ Partially supportedMeloTTS supports only wav (default); all other explicit formats return 400. When omitted the actual upstream format is returned. Aura defaults to mp3; aac returns 400.
melotts supports WAV only. aura-2-en supports mp3/opus/flac/wav/pcm; aac errors.
promptstring可选MeloTTS alias for input; input then text take precedence.
Alias for input; input takes precedence.
voicestring | object可选◐ Partially supportedAura speaker name; custom voice objects are rejected by Aura. MeloTTS ignores voice with a warning unless provider.require_parameters is true, in which case it returns 400.
Only aura-2-en supports native speaker names such as thalia/apollo/orion/luna/zeus; alloy and objects are unsupported. Omit on melotts.
▸ 展开子字段(1)
idstring必填Id of a custom voice. Custom voice objects are not supported by these models and answer 400; use the string form of `voice` with an Aura speaker name.
instructionsstring可选○ UnsupportedAccepted by the protocol; these Cloudflare models reject it with 400.
Both melotts and aura-2-en return 400.
speednumber可选◐ Partially supportedOnly 1 is representable by these Cloudflare models.
Only the default value 1 is accepted; other speeds are unsupported and return errors.
stream_formatstring可选◐ Partially supportedOnly audio is supported; the response is buffered binary audio.
audio works; sse returns 400.
textstring可选Native alias for input; input wins.
Alias for input; input takes precedence.
speakerstring可选◐ Partially supportedAura alias for voice; voice wins.
aura-2-en supports native speaker names; melotts returns 400.
▸ 更多参数(5)
langstring可选◐ Partially supportedMeloTTS language; defaults to en. Use this field to select language; voice is not supported by MeloTTS.
melotts supports en/fr/es/zh; ja/ko error. aura-2-en does not support lang.
encodingstring可选◐ Partially supportedAura native encoding; response_format wins; mulaw/alaw/aac return 400 when used to select the format.
melotts supports linear16 only; aura-2-en supports tested linear16/flac encodings while mulaw returns 400. response_format takes precedence.
containerstring可选◐ Partially supportedAura container; response_format wins.
aura-2-en supports opus+ogg and linear16+none; container=wav returns 400. melotts does not support this field.
sample_rateinteger可选◐ Partially supportedAura WAV supports 8000/16000/24000/32000/48000; FLAC supports 8000/16000/22050/32000/48000; PCM requires 24000; other formats reject this control.
aura-2-en only: tested wav at 8000/16000 and pcm at 24000. 44100 and custom mp3 rates error. Unsupported on melotts.
bit_rateinteger可选◐ Partially supportedAura bit rate in bits per second. MP3 supports 32000/48000; Opus supports 4000–650000. Other accepted formats reject this control.
aura-2-en only: tested mp3 at 32000/48000 and opus at 64000; mp3=64000 errors. Unsupported on melotts.
Returns
200
melotts outputs WAV and supports input (including text/prompt aliases), lang and default audio options; aura-2-en uses native speaker names. See per-field limits below.
Platform errors (auth, rate limits, validation) and OCR errors use problem+json; other model call errors follow the endpoint's own format (OpenAI or Anthropic) — see error codes
Response
HTTP 200
Audio bytes in the requested format.
audio/mpeg
| Name | Type | Description |
|---|---|---|
| $ | string (binary) |
audio/ogg
| Name | Type | Description |
|---|---|---|
| $ | string (binary) |
audio/aac
| Name | Type | Description |
|---|---|---|
| $ | string (binary) |
audio/flac
| Name | Type | Description |
|---|---|---|
| $ | string (binary) |
audio/wav
| Name | Type | Description |
|---|---|---|
| $ | string (binary) |
audio/pcm
| Name | Type | Description |
|---|---|---|
| $ | string (binary) |
The response body contains audio bytes; the example descriptor records only the captured Content-Type and byte count.