Generate text-to-speech audio using Eleven-v3 from ElevenLabs.
pip install requestsimport requests
response = requests.post(
"https://api.runflow.io/v1/run/tts/eleven-v3",
headers={"Authorization": "Bearer RUNFLOW_API_KEY"},
json={
"text": "Welcome to the Runflow Lab! This week we shipped five new models and honestly...",
"prompt": "Welcome to the Runflow Lab! This week we shipped five new models and honestly..."
},
)
data = response.json()
print(data["audio"]["url"])| Parameter | Type | Description |
|---|---|---|
| text | string | The text to convert to speech |
| voice | string | The voice to use for speech generation |
| language_code | string | Language code (ISO 639-1) used to enforce a language for the model. |
| stability | number | Voice stability (0-1) |
| apply_text_normalization | string | This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. |
| timestamps | boolean | Whether to return timestamps for each word in the generated speech |
| Field | Type | Description |
|---|---|---|
| audio | string | The generated audio file |
| timestamps | string | Timestamps for each word in the generated speech. Only returned if `timestamps` is set to True in the request. |
Get API access in minutes. No GPU setup, no infrastructure to manage.