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

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, outputs holds the transcribed text itself rather than a file URL.

Next Steps

Released under the MIT License.