Skip to content

How to Generate Speech ​

Convert text into speech audio.

Quick Start ​

Speech is fast enough for sync mode:

bash
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."
  }'
python
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])
javascript
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 ​

SlugNotes
elevenlabs/eleven-3/text-to-speechHigh quality, multilingual
bilibili/index-tts-2/text-to-speechStrong Chinese voices
bytedance/seed-audio-1/text-to-speechPrompt-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:

bash
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"
  }'
SlugNotes
minimax/music-2.6/text-to-musicVocals and instrumentals
elevenlabs/eleven-music/text-to-musicInstrumental scoring
ace-step/ace-step-1.5/text-to-musicFast generation

Transcription ​

The reverse direction is speech-to-text:

bash
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:

json
{
  "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.

bash
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
  }'
FieldTypeDescription
file_urlsarray of stringRequired. Exactly 1 public HTTP/HTTPS audio or video URL
language_hintsarray of stringUp to 4 language codes, e.g. ["zh", "en"]. Omit to detect automatically
diarization_enabledbooleanSpeaker diarization (mono audio only, best under 2 hours). Adds speaker_id to sentences
speaker_countintegerExpected speaker count, 2-100. Only used when diarization_enabled is true
keep_dialectbooleanKeep dialect expressions instead of converting to Mandarin. Default false
channel_idarray of integerAudio tracks to transcribe. Default [0]. Each track is billed separately
vocabularyobjectInstant hotwords, {"word": weight}, weight 1-5 or 50 (super hotword)
contextarray of objectConversation context to improve domain terms, in the official message format
special_word_filterstringSensitive 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:

json
{
  "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 ​

Released under the MIT License.