> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Development Dreamina Videos

> Dreamina 集成指南 - Ace Data Cloud

## 即梦数字人视频生成 API

`POST https://api.acedata.cloud/dreamina/videos`

音频驱动的数字人口播视频生成（OmniHuman 1.5）。提供一张人物照片和一段驱动音频，生成人物开口说话、口型同步的视频。

### 请求头

| 头 | 值 |
| - | - |
| `Authorization` | `Bearer &lt;你的 API Key>` |
| `Content-Type` | `application/json` |

### 请求参数

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 否 | 模型，默认 `omnihuman-1.5` |
| `image_url` | string | 是 | 人物照片的公网 URL，建议清晰正脸 |
| `audio_url` | string | 是 | 驱动音频的公网 URL（mp3/wav），建议 \< 60 秒 |
| `prompt` | string | 否 | 控制表情、情绪、稳定性与风格 |
| `mask_url` | string\[] | 否 | 主体 mask URL，用于多人图中指定驱动对象 |
| `callback_url` | string | 否 | 传入则立即返回 `task_id`，结果生成后回调该地址 |
| `async` | boolean | 否 | 设为 `true` 时立即返回 `task_id`，无需 `callback_url`，通过 `/dreamina/tasks` 轮询结果 |

### 输入建议

* **图片**：清晰、光线良好的正面人像效果最佳；人脸无遮挡、在画面中占比适中。
* **音频**：mp3/wav，需公网可达。建议时长控制在 60 秒以内（1080p 建议 ≤30 秒，720p ≤60 秒）。
* `image_url` 与 `audio_url` 都必须能被公网访问。

### 响应示例

```json theme={null}
{
  "success": true,
  "task_id": "0c0b4d3a-2f1e-4a6b-9c2d-2b3c4d5e6f70",
  "trace_id": "a9063166-26ed-4451-85b5-54e896817c69",
  "data": {
    "task_id": "362b4fed67bd11f1ad1100163e57d510",
    "status": "done",
    "video_url": "https://cdn.acedata.cloud/634d760216.mp4",
    "image_url": "https://cdn.acedata.cloud/4hfydw.jpg",
    "audio_url": "https://cdn.acedata.cloud/6f7d62b18b.wav"
  }
}
```

### 异步与查询

接口默认同步返回最终视频。对于较长任务，可使用两种异步模式之一：

* 传入 `callback_url`：接口立即返回 `task_id`，结果生成后回调该地址。
* 传入 `async: true`：接口立即返回 `task_id`，再通过 `POST /dreamina/tasks`（免费）按 `task_id` 或 `trace_id` 轮询结果。

轮询契约详见 [Dreamina Tasks API](https://platform.acedata.cloud/documents/dreamina-tasks-integration)。

### 错误处理

| 状态码 | code | 含义 |
| - | - | - |
| 400 | `bad_request` | 参数缺失或无效（如 `image_url` / `audio_url`） |
| 401 | `authorization_missing` / `invalid_token` | 授权令牌缺失或无效 |
| 403 | `forbidden` | 余额/配额不足，或上游未授权 |
| 429 | `too_many_requests` | 请求过多，超出速率限制 |
| 500 | `api_error` | 服务器内部错误 |

```json theme={null}
{
  "error": {
    "code": "bad_request",
    "message": "image_url is required (a public URL of a portrait image)"
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
```

### 计费

按生成视频时长计费，最大套餐约 **¥1/秒**（如 10 秒视频约 ¥10）。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.