More APIs
Text to Speech
Convert text to natural-sounding audio using TTS models.
DEVUP AI hosts text-to-speech models that convert text into natural-sounding audio. Browse all TTS models.
Endpoint
POSThttps://api.devupai.com/v1/audio/speech
Example
import os
import requests
API_KEY = os.environ["DEVUP_API_KEY"]
resp = requests.post(
"https://api.devupai.com/v1/audio/speech",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"model": "hexgrad/Kokoro-82M", "input": "Hello from DEVUP AI"},
timeout=60,
)
resp.raise_for_status()
audio_url = resp.json()["url"]
audio = requests.get(audio_url, timeout=60)
audio.raise_for_status()
with open("speech.mp3", "wb") as f:
f.write(audio.content)Response
The response is JSON. url is a download link to the audio file. It expires 5 minutes after it is issued, and the file is deleted 30 minutes after it is created.
Additional parameters
Each model may expose additional parameters such as voice selection, speed, and language. Check the model's individual API documentation page for supported options.