通过统一接口调用 ElevenLabs 和 Minimax 语音合成服务,支持多语言、多音色的高质量 TTS。
所有请求需在 Header 中携带 Bearer Token:
Authorization: Bearer YOUR_API_KEY
/api/v1/audio/tts创建语音合成任务
/api/v1/audio/tts?task_id=xxx查询任务状态并获取音频链接
选择语音服务商查看对应的参数和示例
ElevenLabs 行业领先的文本转语音服务,超低延迟,支持 70+ 语言,表现力极强。
eleven-tts-flasheleven-tts-turboeleven-tts-multilingualeleven-tts-v3eleven-dialogueeleven-isolatoreleven-dubbingEXAVITQu4vr4xnSDxMaLhpp4J3VqNfWAUOO0d1UspNInz6obpgDQGcFmaJgBJBFqnCBsd6RMkjVDRZzbcgSgspJ2msm6clMCkdW9onwK4e9ZLuTAKqWW03F9# 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": "EXAVITQu4vr4xnSDxMaL",
"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"
}
}在创建请求中传入 callback_url 后,任务进入 completed 或 failed 终态时,我们会向该地址发起一次 HTTP POST。请求头仅包含 Content-Type: application/json,无签名头。失败会自动重试 3 次(指数退避 1s/2s/4s,单次超时 10s);如果仍未成功,后台会在 30 分钟内继续补偿重发,直到接收端返回 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 | "CONTENT_MODERATION | INVALID_INPUT | INSUFFICIENT_BALANCE | UPSTREAM_BUSY | UPSTREAM_FAILED | TIMEOUT | INTERNAL_ERROR | OTHER",
"failMsg": null | "string",
"retryable": true | false, // present when state=failed: safe to retry/fallback
"costTime": 12345, // duration in ms
"completeTime": 1705123460000, // ms epoch
"createTime": 1705123450000 // ms epoch
}
}注意:data.param 与 data.resultJson 都是 JSON 字符串,使用前必须 JSON.parse 一次。
{
"resultUrls": ["https://r2.apimodels.app/audio/xxx.mp3"],
"audioDuration": 12.5 // optional, seconds
}resultUrls 是 R2 托管的音频 URL 数组,state=completed 时长度通常为 1。state=failed 时 resultJson 通常为 null 或 {"resultUrls":[]},请不要假设一定有音频链接。
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
})pending任务已排队,等待处理processing语音合成中completed合成成功,可获取音频链接failed合成失败400请求参数错误或缺失401API 密钥无效402积分不足404任务 ID 不存在500服务器内部错误下列所有模型通过统一 API、一个 key 即可调用。点击模型查看完整 playground 与文档。
| 模型 | model 参数 | 价格 | 说明 |
|---|---|---|---|
| Suno v5 音乐生成 | suno-v5 | $0.26 / per song (2 variants) | AI music generation — full songs with vocals + lyrics from a one-line idea (inspiration), your own lyrics (custom), or instrumental only. Also sound effects, continue, cover, and voice personas. Each run returns 2 variants. |
| Eleven Flash v2.5 | eleven-tts-flash | $0.0425 / 1K chars | Ultra low latency model in 32 languages. Ideal for real-time conversational use cases. |
| Eleven Turbo v2.5 | eleven-tts-turbo | $0.0425 / 1K chars | High quality, low latency model in 32 languages. Best for developer use cases where speed matters. |
| Eleven Multilingual v2 | eleven-tts-multilingual | $0.085 / 1K chars | Most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production. |
| Eleven v3 | eleven-tts-v3 | $0.085 / 1K chars | Most expressive model with 70+ languages. Supports audio tags like [laughs], [whispers] for emotional control. |
| ElevenLabs Dialogue | eleven-dialogue | $0.085 / 1K chars | Multi-speaker dialogue generation with natural conversation flow. Perfect for podcasts and audiobooks. |
| Voice Isolator | eleven-isolator | $0.102 / min | Extract speech from background noise, music and ambient sounds. Clean audio extraction. |
| AI Dubbing | eleven-dubbing | $0.2805 / min | Translate audio/video while preserving emotion, timing and tone. Automatic lip-sync. |
| Minimax Speech 2.8 HD | minimax-speech-2.8-hd | $0.07 / 1K chars | Latest high-fidelity TTS by MiniMax (海螺). Predicts emotion and intonation from context for ultra-natural, expressive, personalized speech. Supports voice clone and voice design. |
| Minimax Speech 2.8 Turbo | minimax-speech-2.8-turbo | $0.04 / 1K chars | Latest fast, cost-effective async TTS by MiniMax (海螺). Great quality-to-price for high-volume synthesis. Supports voice clone and voice design. |
| Minimax Speech 02 HD | minimax-speech-02-hd | $0.07 / 1K chars | High-fidelity TTS by MiniMax (海螺). Predicts emotion and intonation from context to produce ultra-natural, expressive, personalized speech — built for social, podcasts, audiobooks, news, education and digital humans. Supports voice clone and voice design. |
| Kling Custom Voice | kling-custom-voice | $0.006 / per call | Create custom voice profiles from audio samples. Upload .mp3/.wav/.mp4/.mov (5-30s) or reference a video ID. |
| Kling Face Recognition | kling-identify-face | $0.001 / per call | Identify faces in a video and return a session ID and face IDs for Kling lip-sync video generation. |
| Kling Sound Effects | kling-sound-effects | $0.030 / per call | Generate sound effects from text descriptions. 3-10 second audio with natural quality. |
| Kling Video-to-Audio | kling-video-to-audio | $0.003 / per call | Auto-generate sound effects and background music for videos. Supports ASMR mode for immersive content. |
| Kling TTS | kling-tts | $0.01 / per call | Text-to-speech with multiple voice options. Adjustable speed and multi-language support. |
| Minimax Speech 2.6 HD | minimax-speech-2.6-hd | $0.07 / 1K chars | High-definition async TTS by Minimax (海螺). Rich expressiveness with natural prosody. Supports voice clone and voice design. |
| Minimax Speech 02 Turbo | minimax-speech-02-turbo | $0.04 / 1K chars | Fast and cost-effective async TTS by Minimax (海螺). Supports voice clone, voice design, and pronunciation dictionaries. |