Text to Speech
Synthesize speech from text, voice, and language parameters. Synchronous API: submit a request and receive an audio URL.
Generate speech from text and a system voice. Supports automatic language detection or an explicit language, and returns a downloadable audio URL synchronously.
This is a synchronous API: submit a request and receive the synthesized result directly, with no task polling. The audio URL is valid for 24 hours.
Base URL
https://api.autorouter.top— Production
Authentication
BearerAuth: http (bearer)
Authenticate using a Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
Endpoints
POST /v1/audio/speech
Create Text-to-Speech Request
Pass text, a voice, and optional language parameters. The response includes a URL for the synthesized audio. This path is shared with Bilibili IndexTTS; distinguish them with model. Qwen uses qwen3-tts-flash.
Request Body
Content-Type: application/json
Example:
{
"model": "qwen3-tts-flash",
"input": "那我来给大家推荐一款T恤,这款呢真的是超级好看,这个颜色呢很显气质。",
"voice": "Cherry"
}Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name. Fixed to qwen3-tts-flash |
input | string | Yes | Text to synthesize. Maximum 600 characters |
voice | string | Yes | System voice name. Examples: Cherry, Ethan, Serena, Chelsie |
metadata | object | No | Metadata such as language |
metadata. | string | No | Synthesis language. Default Auto. Available values: Auto, Chinese, English, German, Italian, Portuguese, Spanish, Japanese, Korean, French, Russian |
metadataobject(Optional)
Metadata such as language. If omitted, language is auto-detected.
Synthesis language. Case-insensitive. Default Auto (auto-detect).
AutoChineseEnglishGermanItalianPortugueseSpanishJapaneseKoreanFrenchRussian
Responses
200: Synthesis succeeded; audio URL returned
Content-Type: application/json
400: Bad request / invalid parameters
Content-Type: application/json
Request Example
curl -X POST "https://api.autorouter.top/v1/audio/speech" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"model": "qwen3-tts-flash",
"input": "那我来给大家推荐一款T恤,这款呢真的是超级好看,这个颜色呢很显气质。",
"voice": "Cherry"
}'Response Example
{
"request_id": "5c63c65c-cad8-4bf4-959d-xxxxxxxxxxxx",
"code": "",
"message": "",
"output": {
"finish_reason": "stop",
"audio": {
"data": "",
"url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xx/xxxxxxxx.wav?Expires=1766113409&OSSAccessKeyId=LTAI5xxxxxx&Signature=xxxxxx",
"id": "audio_5c63c65c-cad8-4bf4-959d-xxxxxxxxxxxx",
"expires_at": 1766113409
}
},
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"characters": 195
}
}Response fields:
| Name | Type | Description |
|---|---|---|
request_id | string | Unique request ID for tracing and troubleshooting |
code | string | Business error code. Empty string on success |
message | string | Business error message. Empty string on success |
output | object | Synthesis output |
output. | string | null | Finish reason. null while generating; stop when complete |
output. | object | Audio information |
output. | string | Full URL of the synthesized audio, valid for 24 hours |
output. | string | Base64 audio used in streaming. Always an empty string in synchronous mode |
output. | string | Audio identifier |
output. | integer | Expiration timestamp of the audio URL |
usage | object | Usage statistics |
usage. | integer | Input character count, used for billing |
usage. | integer | Always 0 |
usage. | integer | Always 0 |
Error Handling
HTTP 400 Parameter Errors
| Scenario | Response |
|---|---|
Missing input / voice / model | {"error":{"message":". |
input exceeds 600 characters | {"error":{"message":". |
HTTP 401 / 403 Auth Errors
401 Unauthorized: API Key invalid or expired403 Forbidden: API Key has no access to this model (check token's model allowlist)
HTTP 402 Insufficient Balance
Returns insufficient user quota. Top up at the AutoRouter console.
Video Editing
Edit an existing video with instruction-based editing and video transfer. Async task API: submit a request, receive a task_id, then poll for status to get the result.
Text to Speech
Synthesize speech from text, voice, and audio parameters. Supports streaming and non-streaming, with hex or URL output.