Access ElevenLabs and Minimax text-to-speech through a unified API -- multilingual, expressive, and high-quality audio synthesis.
Add Authorization header to all requests:
Authorization: Bearer YOUR_API_KEY
/api/v1/audio/ttsCreate a TTS task
/api/v1/audio/tts?task_id=xxxQuery task status and get audio URL
Select a provider to see its parameters and examples
Industry-leading text-to-speech from ElevenLabs. Ultra-low latency, 70+ languages, and highly expressive voice synthesis.
eleven-tts-flasheleven-tts-turboeleven-tts-multilingualeleven-tts-v321m00Tcm4TlvDq8ikWAMpNInz6obpgDQGcFmaJgBEXAVITQu4vr4xnSDxMaL# Step 1: Create TTS task
curl -X POST https://apimodels.app/api/v1/audio/tts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eleven-tts-v3",
"text": "Hello, this is a test of ElevenLabs text-to-speech.",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"language_code": "en"
}'
# Step 2: Poll status
curl "https://apimodels.app/api/v1/audio/tts?task_id=TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "pending"
}
}{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "completed",
"result": "https://cdn.example.com/audio.mp3",
"createTime": 1705123450000,
"completeTime": 1705123460000
}
}{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "failed",
"failMsg": "Invalid voice_id"
}
}Pass callback_url in the create request. When the task reaches the completed or failed terminal state, our server sends a single HTTP POST to that URL with Content-Type: application/json (no signing header). Delivery is retried up to 3 times (exponential backoff 1s/2s/4s, 10s per attempt); if still unsuccessful, a background job keeps retrying for up to 30 minutes until your endpoint returns 2xx.
POST {your callback_url}
Content-Type: application/json
{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"model": "<provider>/<model_name>",
"state": "completed" | "failed",
"param": "<JSON string>", // request params, JSON.parse once
"resultJson": "<JSON string> | null", // result object, JSON.parse once
"failCode": null | "string",
"failMsg": null | "string",
"costTime": 12345, // duration in ms
"completeTime": 1705123460000, // ms epoch
"createTime": 1705123450000 // ms epoch
}
}Note: data.param and data.resultJson are both JSON strings — call JSON.parse once on each.
{
"resultUrls": ["https://r2.apimodels.app/audio/xxx.mp3"],
"audioDuration": 12.5 // optional, seconds
}resultUrls is an array of R2-hosted audio URLs (length 1 in success). When state=failed, resultJson is typically null or {"resultUrls":[]} — do not assume an audio link is present.
app.post('/webhook/audio', express.json(), (req, res) => {
const { taskId, state, resultJson, failMsg } = req.body.data
if (state === 'completed') {
const r = JSON.parse(resultJson)
console.log('audio ready', taskId, r.resultUrls[0], r.audioDuration)
} else {
console.warn('audio failed', taskId, failMsg)
}
res.status(200).end() // must be 2xx, otherwise we retry
})pendingQueued, waiting to startprocessingAudio is being synthesizedcompletedDone -- audio URL available in result fieldfailedSynthesis failed400Bad Request -- invalid or missing parameters401Unauthorized -- invalid API key402Payment Required -- insufficient credits404Not Found -- task ID not found500Internal Server Error