How to Generate Speech
Convert text into speech audio.
Quick Start
Speech is fast enough for sync mode:
curl -X POST "https://api.get3w.com/v1/elevenlabs/eleven-3/text-to-speech?sync=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Welcome to Get3W, the unified AI platform."
}'import requests
response = requests.post(
"https://api.get3w.com/v1/elevenlabs/eleven-3/text-to-speech?sync=true",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={"text": "Welcome to Get3W, the unified AI platform."}
)
data = response.json()
print(data["outputs"][0])const response = await fetch(
"https://api.get3w.com/v1/elevenlabs/eleven-3/text-to-speech?sync=true",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
text: "Welcome to Get3W, the unified AI platform."
})
}
);
const data = await response.json();
console.log(data.outputs[0]);The outputs array contains a URL to the generated audio file.
Available Models
| Slug | Notes |
|---|---|
elevenlabs/eleven-3/text-to-speech | High quality, multilingual |
bilibili/index-tts-2/text-to-speech | Strong Chinese voices |
bytedance/seed-audio-1/text-to-speech | Prompt-driven speech, SFX and music up to 120s; reference audio (@音频1), voice ID or image. ¥1.1/min |
Voice selection, speed, and language options are model-specific. Check the model's page on get3w.com/models for its parameter schema before hardcoding values.
Music Generation
Use the text-to-music run type for music rather than speech:
curl -X POST "https://api.get3w.com/v1/minimax/music-2.6/text-to-music?sync=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Upbeat acoustic guitar, warm and optimistic, 120 bpm"
}'| Slug | Notes |
|---|---|
minimax/music-2.6/text-to-music | Vocals and instrumentals |
elevenlabs/eleven-music/text-to-music | Instrumental scoring |
ace-step/ace-step-1.5/text-to-music | Fast generation |
Transcription
The reverse direction is speech-to-text:
curl -X POST "https://api.get3w.com/v1/openai/whisper-large-v3-turbo/speech-to-text?sync=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://your-cdn.com/recording.mp3"
}'For speech-to-text, each item in outputs is a transcript object rather than a file URL. For Whisper, text holds the full transcript and segments carries sentence-level timestamps in seconds:
{
"outputs": [
{
"text": "Hello, let's go over the project status. Sure, I'll start.",
"segments": [
{ "index": 1, "start": 0.1, "end": 3.82, "text": "Hello, let's go over the project status." },
{ "index": 2, "start": 3.82, "end": 6.5, "text": "Sure, I'll start." }
]
}
]
}Long recordings with Qwen-Audio ASR
alibaba/qwen-audio-3.1-asr-flash-filetrans/speech-to-text handles recordings up to 12 hours. Its input and output match the official Alibaba Cloud file transcription API: the official input and parameters fields go at the top level of the request body, with the same names and values.
curl -X POST "https://api.get3w.com/v1/alibaba/qwen-audio-3.1-asr-flash-filetrans/speech-to-text" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_urls": ["https://your-cdn.com/meeting.mp3"],
"language_hints": ["zh", "en"],
"diarization_enabled": true
}'| Field | Type | Description |
|---|---|---|
file_urls | array of string | Required. Exactly 1 public HTTP/HTTPS audio or video URL |
language_hints | array of string | Up to 4 language codes, e.g. ["zh", "en"]. Omit to detect automatically |
diarization_enabled | boolean | Speaker diarization (mono audio only, best under 2 hours). Adds speaker_id to sentences |
speaker_count | integer | Expected speaker count, 2-100. Only used when diarization_enabled is true |
keep_dialect | boolean | Keep dialect expressions instead of converting to Mandarin. Default false |
channel_id | array of integer | Audio tracks to transcribe. Default [0]. Each track is billed separately |
vocabulary | object | Instant hotwords, {"word": weight}, weight 1-5 or 50 (super hotword) |
context | array of object | Conversation context to improve domain terms, in the official message format |
special_word_filter | string | Sensitive word handling rules |
outputs[0] is the official transcription JSON, unchanged, plus a top-level text. Times are in milliseconds, and words gives word-level timestamps:
{
"outputs": [
{
"text": "Hello world, 这里是阿里巴巴语音实验室。",
"file_url": "https://your-cdn.com/meeting.mp3",
"properties": { "audio_format": "pcm_s16le", "channels": [0], "original_sampling_rate": 16000, "original_duration_in_milliseconds": 3834 },
"transcripts": [
{
"channel_id": 0,
"content_duration_in_milliseconds": 3720,
"text": "Hello world, 这里是阿里巴巴语音实验室。",
"sentences": [
{
"begin_time": 100, "end_time": 3820, "text": "Hello world, 这里是阿里巴巴语音实验室。", "sentence_id": 1, "speaker_id": 0,
"words": [
{ "begin_time": 100, "end_time": 596, "text": "Hello ", "punctuation": "" },
{ "begin_time": 596, "end_time": 844, "text": "world", "punctuation": ", " }
]
}
]
}
]
}
]
}Differences from the official API: the request body is flat, outputs[0] adds text, vocabulary_id is not supported (use vocabulary), task metadata such as task_id and transcription_url is not returned, and billing follows Get3W pricing.
Next Steps
- How to Create a Digital Human — Drive an avatar with generated speech
- Complete Workflow Tutorial — Chain speech into video