多角色对话合成
curl --request POST \
--url https://api.mountsea.ai/eleven/dialogue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"text": "[giggling] Knock knock",
"voiceId": "JBFqnCBsd6RMkjVDRZzb"
},
{
"text": "[curious] Who is there?",
"voiceId": "Aw4FAjKCGjjNkVhN1Xmq"
}
],
"model": "eleven_v3",
"outputFormat": "mp3_44100_128",
"withTimestamps": false,
"languageCode": "en",
"settings": {
"stability": 0.5
},
"seed": 12345,
"applyTextNormalization": "auto"
}
'import requests
url = "https://api.mountsea.ai/eleven/dialogue"
payload = {
"inputs": [
{
"text": "[giggling] Knock knock",
"voiceId": "JBFqnCBsd6RMkjVDRZzb"
},
{
"text": "[curious] Who is there?",
"voiceId": "Aw4FAjKCGjjNkVhN1Xmq"
}
],
"model": "eleven_v3",
"outputFormat": "mp3_44100_128",
"withTimestamps": False,
"languageCode": "en",
"settings": { "stability": 0.5 },
"seed": 12345,
"applyTextNormalization": "auto"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: [
{text: '[giggling] Knock knock', voiceId: 'JBFqnCBsd6RMkjVDRZzb'},
{text: '[curious] Who is there?', voiceId: 'Aw4FAjKCGjjNkVhN1Xmq'}
],
model: 'eleven_v3',
outputFormat: 'mp3_44100_128',
withTimestamps: false,
languageCode: 'en',
settings: {stability: 0.5},
seed: 12345,
applyTextNormalization: 'auto'
})
};
fetch('https://api.mountsea.ai/eleven/dialogue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mountsea.ai/eleven/dialogue",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
'text' => '[giggling] Knock knock',
'voiceId' => 'JBFqnCBsd6RMkjVDRZzb'
],
[
'text' => '[curious] Who is there?',
'voiceId' => 'Aw4FAjKCGjjNkVhN1Xmq'
]
],
'model' => 'eleven_v3',
'outputFormat' => 'mp3_44100_128',
'withTimestamps' => false,
'languageCode' => 'en',
'settings' => [
'stability' => 0.5
],
'seed' => 12345,
'applyTextNormalization' => 'auto'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mountsea.ai/eleven/dialogue"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"text\": \"[giggling] Knock knock\",\n \"voiceId\": \"JBFqnCBsd6RMkjVDRZzb\"\n },\n {\n \"text\": \"[curious] Who is there?\",\n \"voiceId\": \"Aw4FAjKCGjjNkVhN1Xmq\"\n }\n ],\n \"model\": \"eleven_v3\",\n \"outputFormat\": \"mp3_44100_128\",\n \"withTimestamps\": false,\n \"languageCode\": \"en\",\n \"settings\": {\n \"stability\": 0.5\n },\n \"seed\": 12345,\n \"applyTextNormalization\": \"auto\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mountsea.ai/eleven/dialogue")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n {\n \"text\": \"[giggling] Knock knock\",\n \"voiceId\": \"JBFqnCBsd6RMkjVDRZzb\"\n },\n {\n \"text\": \"[curious] Who is there?\",\n \"voiceId\": \"Aw4FAjKCGjjNkVhN1Xmq\"\n }\n ],\n \"model\": \"eleven_v3\",\n \"outputFormat\": \"mp3_44100_128\",\n \"withTimestamps\": false,\n \"languageCode\": \"en\",\n \"settings\": {\n \"stability\": 0.5\n },\n \"seed\": 12345,\n \"applyTextNormalization\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mountsea.ai/eleven/dialogue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"text\": \"[giggling] Knock knock\",\n \"voiceId\": \"JBFqnCBsd6RMkjVDRZzb\"\n },\n {\n \"text\": \"[curious] Who is there?\",\n \"voiceId\": \"Aw4FAjKCGjjNkVhN1Xmq\"\n }\n ],\n \"model\": \"eleven_v3\",\n \"outputFormat\": \"mp3_44100_128\",\n \"withTimestamps\": false,\n \"languageCode\": \"en\",\n \"settings\": {\n \"stability\": 0.5\n },\n \"seed\": 12345,\n \"applyTextNormalization\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>"
}ElevenLabs
多角色对话合成
合成多角色对话音频
POST
/
eleven
/
dialogue
多角色对话合成
curl --request POST \
--url https://api.mountsea.ai/eleven/dialogue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"text": "[giggling] Knock knock",
"voiceId": "JBFqnCBsd6RMkjVDRZzb"
},
{
"text": "[curious] Who is there?",
"voiceId": "Aw4FAjKCGjjNkVhN1Xmq"
}
],
"model": "eleven_v3",
"outputFormat": "mp3_44100_128",
"withTimestamps": false,
"languageCode": "en",
"settings": {
"stability": 0.5
},
"seed": 12345,
"applyTextNormalization": "auto"
}
'import requests
url = "https://api.mountsea.ai/eleven/dialogue"
payload = {
"inputs": [
{
"text": "[giggling] Knock knock",
"voiceId": "JBFqnCBsd6RMkjVDRZzb"
},
{
"text": "[curious] Who is there?",
"voiceId": "Aw4FAjKCGjjNkVhN1Xmq"
}
],
"model": "eleven_v3",
"outputFormat": "mp3_44100_128",
"withTimestamps": False,
"languageCode": "en",
"settings": { "stability": 0.5 },
"seed": 12345,
"applyTextNormalization": "auto"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: [
{text: '[giggling] Knock knock', voiceId: 'JBFqnCBsd6RMkjVDRZzb'},
{text: '[curious] Who is there?', voiceId: 'Aw4FAjKCGjjNkVhN1Xmq'}
],
model: 'eleven_v3',
outputFormat: 'mp3_44100_128',
withTimestamps: false,
languageCode: 'en',
settings: {stability: 0.5},
seed: 12345,
applyTextNormalization: 'auto'
})
};
fetch('https://api.mountsea.ai/eleven/dialogue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mountsea.ai/eleven/dialogue",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
'text' => '[giggling] Knock knock',
'voiceId' => 'JBFqnCBsd6RMkjVDRZzb'
],
[
'text' => '[curious] Who is there?',
'voiceId' => 'Aw4FAjKCGjjNkVhN1Xmq'
]
],
'model' => 'eleven_v3',
'outputFormat' => 'mp3_44100_128',
'withTimestamps' => false,
'languageCode' => 'en',
'settings' => [
'stability' => 0.5
],
'seed' => 12345,
'applyTextNormalization' => 'auto'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mountsea.ai/eleven/dialogue"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"text\": \"[giggling] Knock knock\",\n \"voiceId\": \"JBFqnCBsd6RMkjVDRZzb\"\n },\n {\n \"text\": \"[curious] Who is there?\",\n \"voiceId\": \"Aw4FAjKCGjjNkVhN1Xmq\"\n }\n ],\n \"model\": \"eleven_v3\",\n \"outputFormat\": \"mp3_44100_128\",\n \"withTimestamps\": false,\n \"languageCode\": \"en\",\n \"settings\": {\n \"stability\": 0.5\n },\n \"seed\": 12345,\n \"applyTextNormalization\": \"auto\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mountsea.ai/eleven/dialogue")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n {\n \"text\": \"[giggling] Knock knock\",\n \"voiceId\": \"JBFqnCBsd6RMkjVDRZzb\"\n },\n {\n \"text\": \"[curious] Who is there?\",\n \"voiceId\": \"Aw4FAjKCGjjNkVhN1Xmq\"\n }\n ],\n \"model\": \"eleven_v3\",\n \"outputFormat\": \"mp3_44100_128\",\n \"withTimestamps\": false,\n \"languageCode\": \"en\",\n \"settings\": {\n \"stability\": 0.5\n },\n \"seed\": 12345,\n \"applyTextNormalization\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mountsea.ai/eleven/dialogue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"text\": \"[giggling] Knock knock\",\n \"voiceId\": \"JBFqnCBsd6RMkjVDRZzb\"\n },\n {\n \"text\": \"[curious] Who is there?\",\n \"voiceId\": \"Aw4FAjKCGjjNkVhN1Xmq\"\n }\n ],\n \"model\": \"eleven_v3\",\n \"outputFormat\": \"mp3_44100_128\",\n \"withTimestamps\": false,\n \"languageCode\": \"en\",\n \"settings\": {\n \"stability\": 0.5\n },\n \"seed\": 12345,\n \"applyTextNormalization\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>"
}通过
inputs[] 列表合成多角色对话,每项包含 text 与 voiceId。对应 ElevenLabs Text to Dialogue:
- 默认:
POST /v1/text-to-dialogue/stream withTimestamps=true:POST /v1/text-to-dialogue/stream/with-timestamps
这是一个异步任务。响应中包含
taskId — 使用获取任务状态轮询。成功时 result 含 audioUrl。计费优先使用官方 characterCost,本地 textLength 作兜底。限制
- 每次请求最多 100 条台词(
inputs) - 最多 10 个不同的
voiceId - 每行文本 1–5000 字符;可含情感标签,如
[giggling]、[curious]
推荐流程
1
获取音色
调用获取音色列表拿到
voiceId(以及可选的 previewUrl)。2
创建对话任务
调用
POST /eleven/dialogue,传入 inputs(以及可选的 model、outputFormat、withTimestamps 等)。3
轮询音频结果
轮询
GET /eleven/tasks?taskId=xxx 直至状态为 completed,再读取 result.audioUrl。模型
| 模型 | 说明 |
|---|---|
eleven_v3 | Dialogue 默认模型(推荐) |
eleven_multilingual_v2 | 多语言语音 |
eleven_turbo_v2_5 | 更快生成 |
eleven_flash_v2_5 | 更低延迟 |
需要字符级时间戳时设置
withTimestamps: true。可用 settings.stability(0–1)控制表达稳定性。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
对话台词列表,每项含 text + voiceId
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
示例:
[
{
"text": "[giggling] Knock knock",
"voiceId": "JBFqnCBsd6RMkjVDRZzb"
},
{
"text": "[curious] Who is there?",
"voiceId": "Aw4FAjKCGjjNkVhN1Xmq"
}
]
模型(Dialogue 官方默认 eleven_v3)
可用选项:
eleven_v3, eleven_multilingual_v2, eleven_turbo_v2_5, eleven_flash_v2_5 示例:
"eleven_v3"
音频输出格式
可用选项:
mp3_22050_32, mp3_24000_48, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_32000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192 示例:
"mp3_44100_128"
是否返回字符级时间戳。true 时走官方 stream/with-timestamps
示例:
false
语言代码 ISO-639-1(部分模型支持)
示例:
"en"
对话生成设置
Show child attributes
Show child attributes
随机种子
示例:
12345
文本归一化
可用选项:
auto, on, off 示例:
"auto"
响应
200 - application/json
任务创建成功
任务 ID,用于后续查询结果
⌘I