Chatterboxhd · Text to Speech
集成
模型 id
resemble-ai/chatterboxhd/text-to-speech
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/resemble-ai/chatterboxhd/text-to-speech?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/resemble-ai/chatterboxhd/text-to-speech?wait=20", {
method: "POST",
headers,
body: JSON.stringify({}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.ru/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/resemble-ai/chatterboxhd/text-to-speech", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/zh/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.ru/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "resemble-ai/chatterboxhd/text-to-speech",
"input": {}
}
通过 Doitong API 调用 Chatterboxhd · Text to Speech 模型(resemble-ai/chatterboxhd/text-to-speech)。智能体文档:https://doitong.com/zh/developers/models/resemble-ai/chatterboxhd/text-to-speech.md
POST https://api.doitong.ru/v1/run/resemble-ai/chatterboxhd/text-to-speech?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{}
如果响应状态为 "queued" 或 "running",请轮询 GET https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20,直到状态变为 "succeeded";文件位于 outputs[].url。使用相同请求体 POST https://api.doitong.ru/v1/quote/resemble-ai/chatterboxhd/text-to-speech,可在运行前返回确切价格。
与示例类似的文件: $0.011 11 API 积分 · ≈ ₽1.18 运行前会测量你的文件 在此页面运行
你的新 API 密钥。 它仅在此时显示,并且已填入下方的代码和 API 密钥字段中。请妥善保密:切勿将其放入在浏览器中运行的代码。
构建请求
控件根据模型架构生成。更改控件时,代码和价格会同步更新。
POST
/run/resemble-ai/chatterboxhd/text-to-speech?wait=20
报价 → $0.011
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/resemble-ai/chatterboxhd/text-to-speech?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/resemble-ai/chatterboxhd/text-to-speech?wait=20", {
method: "POST",
headers,
body: JSON.stringify({}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.ru/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/resemble-ai/chatterboxhd/text-to-speech", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "resemble-ai/chatterboxhd/text-to-speech",
"input": {},
"wait_seconds": 20
}
}
}
关于 Chatterboxhd · Text to Speech
使用预设 `voice`(Aurora、Blade、Britney、Carl、Cliff、Richard、Rico、Siobhan 或 Vicky)或从 `audio_url` 克隆的声音,根据 `text` 生成语音;克隆声音会覆盖预设声音。`exaggeration`(0.25 到 2)和 `cfg` 控制情绪,`temperature` 和 `seed` 控制变化。`high_quality_audio` 会将输出从 24 kHz 提升至 48 kHz。
参数
发送规范名称或原生名称之一,不要同时发送两者。 规范名称
名称类型
默认值允许值
描述
text可选
类型string
默认值My name is Maximus Decimus Meridius, commander of the Armies of the North, General of the Felix Legions and loyal servant to the true emperor, Marcus Aurelius. Father to a murdered son, husband to a murdered wife. And I will have my vengeance, in this life or the next.
要转换为语音音频的文本内容。
voice可选
类型enum
AuroraBladeBritneyCarlCliffRichardRicoSiobhanVicky
选择 TTS 语音,或同时省略 voice 和音频,让系统随机选择语音。
audio_url可选
audio
类型url · audio
零样本 TTS 的语音克隆样本 URL,优先于 voice 设置。仅在 audio_url 和 voice 都缺失时随机选择语音。
exaggeration可选
类型number
默认值0.5
0.25 – 2
情绪夸张程度,通常范围为 0.25 到 2.0。
cfg可选
类型number
默认值0.5
0 – 1
通过无分类器引导(CFG)设置的条件强度。要获得富有表现力或戏剧性的表达,可将较低的 cfg(例如约 0.3)与约 0.7 或更高的夸张度结合;当参考语音语速较快时,将 cfg 降至约 0.3 也可能改善节奏。典型设置范围为 0.2–1.0。
high_quality_audio可选
类型boolean
默认值false
选择 24kHz 输出(False)或上采样至 48kHz 的高质量音频(True)。启用上采样会增加生成时间。
seed可选
类型integer
默认值0
≥ 0
用于可重复音频生成的种子:0 表示随机选择;固定种子可在其他属性不变时复现完全相同的音频文件。
temperature可选
类型number
默认值0.8
0.05 – 5
生成随机性,通常范围为 0.05 到 5。
必填
规范名称,也可接受
文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件
输出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "resemble-ai/chatterboxhd/text-to-speech",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 11,
"usd": "0.011",
"charged": 11,
"refunded": 0
},
"input": {},
"output": {},
"outputs": [
{
"type": "audio",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
"content_type": "audio/mpeg",
"file_size": 1843200,
"duration": 12,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
- audio
- any生成得到的音频文件。
其他 Chatterboxhd 变体
更多模型:文本转语音
对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/resemble-ai/chatterboxhd/text-to-speech.md. 所有模型和指南: https://doitong.com/developers/llms.txt