Mirage Avatar X
集成
模型 id
mirage-api/avatar-x/reference-to-video
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/mirage-api/avatar-x/reference-to-video?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/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/mirage-api/avatar-x/reference-to-video?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
}),
});
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.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/mirage-api/avatar-x/reference-to-video", 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.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "mirage-api/avatar-x/reference-to-video",
"input": {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
}
}
通过 Doitong API 调用 Mirage Avatar X 模型(mirage-api/avatar-x/reference-to-video)。智能体文档:https://doitong.com/zh/developers/models/mirage-api/avatar-x/reference-to-video.md
POST https://api.doitong.com/v1/run/mirage-api/avatar-x/reference-to-video?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
}
如果响应状态为 "queued" 或 "running",请轮询 GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20,直到状态变为 "succeeded";文件位于 outputs[].url。使用相同请求体 POST https://api.doitong.com/v1/quote/mirage-api/avatar-x/reference-to-video,可在运行前返回确切价格。
与示例类似的文件: $3.00 3,000 API 积分 运行前会测量你的文件 在此页面运行
你的新 API 密钥。 它仅在此时显示,并且已填入下方的代码和 API 密钥字段中。请妥善保密:切勿将其放入在浏览器中运行的代码。
构建请求
控件根据模型架构生成。更改控件时,代码和价格会同步更新。
POST
/run/mirage-api/avatar-x/reference-to-video?wait=20
报价 → $3.00
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/mirage-api/avatar-x/reference-to-video?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/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/mirage-api/avatar-x/reference-to-video?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
}),
});
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.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/mirage-api/avatar-x/reference-to-video", 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": "mirage-api/avatar-x/reference-to-video",
"input": {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
},
"wait_seconds": 20
}
}
}
关于 Mirage Avatar X
根据 `audio_url`(3 到 180 秒)生成口型同步的头像视频。视觉内容来自 `video_reference_url`、`image_reference_url` 或素材 `avatar`;两者同时提供时,视频参考优先于图像。`avatar` 选项仅提供视觉内容,不提供音频。参考 URL 必须可通过 HTTPS 公开获取。
参数
发送规范名称或原生名称之一,不要同时发送两者。 规范名称
名称类型
默认值允许值
描述
audio_url必填
audio
类型url · audio
驱动生成视频的音频公共 HTTPS 地址,无需授权标头或 Cookie 即可访问。支持的音频格式包括 FLAC、Opus 或 Vorbis、AAC 或 ALAC、PCM WAV 或 AIFF,以及 MP3。文件必须包含单个单声道或立体声流,时长为 3–180 秒,大小不超过 64 MiB,采样率为 8–48 kHz。
video_reference_url可选
类型string | null
参考视频 HTTPS URL,必须可公开访问且无需授权标头或 Cookie;文件必须包含恰好一个视频流,并至少包含一个适合作为参考的 1 秒片段;音频将被忽略。支持的文件组合为:.mp4、.mov 或 .m4v 搭配 H.264、H.265/HEVC 或 ProRes,或 .webm 搭配 VP8 或 VP9;时长必须为 1 到 120 秒,大小不得超过 1 GiB,显示宽高比必须与 9:16 或 16:9 之一相差不超过 5%。如果同时提供 image_reference_url,则优先使用视频。
avatar可选
类型enum
NoneAyeshaAyesha (16:9)FarhanFarhan (16:9)GiuliaGiulia (16:9)JasmineJasmine (16:9)LukeLuke (16:9)MayaMaya (16:9)MichaelMichael (16:9)Neha
另外 5 个
Neha (16:9)TariqTariq (16:9)ValerieValerie (16:9)仅在未提供图像或视频参考时使用的素材视觉选择;None 和默认值都会保持未设置。该视觉不会提供音频,音频始终来自 audio_url。要选择视觉,请在 [avatar catalog](https://captions.ai/help/docs/api/actor-catalog) 中预览选项,并复制准确的 Avatar 值。
image_reference_url可选
类型string | null
参考图像 HTTPS URL,必须可公开访问且无需 Cookie 或授权标头;提供 video_reference_url 后将忽略此 URL。接受单张 .jpg、.jpeg、.png 或 .webp 格式的静态图像,大小限制为 25 MiB、25 百万像素。较短边至少为 512 px,任一边不得超过 8192 px;宽高比必须与 9:16 或 16:9 相差不超过 5%。
必填
规范名称,也可接受
文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件
输出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "mirage-api/avatar-x/reference-to-video",
"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": 3000,
"usd": "3.00",
"charged": 3000,
"refunded": 0
},
"input": {
"audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3"
},
"output": {
"video": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_name": "0-output.mp4",
"file_size": 1843200
}
},
"outputs": [
{
"type": "video",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_size": 1843200,
"width": 1280,
"height": 720,
"duration": 5,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
- video
- object {url, content_type, file_name, file_size}
其他 Mirage Avatar X 变体
更多模型:唇形同步与数字人
对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/mirage-api/avatar-x/reference-to-video.md. 所有模型和指南: https://doitong.com/developers/llms.txt