Create voice
Create a reusable custom voice from reference audio.
POST /v1/audio/voices
The request uses the selected provider's voice cloning capability and returns voice_id; use voice: { id: voice_id } for subsequent speech synthesis.
Back to Audio endpoint listRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Custom voice name. |
provider | string | Yes | Provider ID; use ali for Qwen. |
audio_sample | file | Yes | Reference audio file: WAV, MP3, or M4A, up to 10 MiB. |
model | string | No | TTS model ID; defaults to qwen-audio-3.0-tts-flash. |
Request examples
curl -X POST "https://api.globalrouter.com/v1/audio/voices" \ -H "Authorization: Bearer $GR_API_KEY" \ -F "name=demo_voice" \ -F "provider=ali" \ -F "model=qwen-audio-3.0-tts-flash" \ -F "audio_sample=@./voice.wav;type=audio/wav"
Response fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | voice_id returned after successful creation. |
object | string | Yes | Always voice. |
name | string | Yes | Voice name submitted at creation. |
Response example
{
"id": "voice_01HV...",
"object": "voice",
"name": "demo_voice"
}Errors
| HTTP | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid Authorization Bearer token. |
| 403 | FORBIDDEN | The current API key is not allowed to call this scope or model. |
| 429 | RATE_LIMITED | Requests are too frequent or the asynchronous task queue is full; reduce concurrency or retry later. |
Notes
- Upload audio_sample using multipart/form-data, not a URL or Base64 text.
- For reliable cloning, use clear, continuous speech: at least 5 seconds is required, 10 to 20 seconds is recommended, and the maximum is 60 seconds.
- Qwen voice creation is billed per request at CNY 0.01.