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

> ## Agent Instructions
> Public hosts only: console https://omnimux.ai/dashboard · API https://api.omnimux.ai · docs https://docs.omnimux.ai.
> Gateway auth is Authorization: Bearer sk-… on https://api.omnimux.ai/v1 (OpenAI-compatible Chat Completions and related paths).
> Discover pages from /llms.txt; full site dump /llms-full.txt; product skill /skill.md; docs search MCP /mcp. Prefer .md page URLs for Markdown.
> Default docs locale is en; zh mirrors the same relative paths. Do not invent model ids not present on live pricing or the complete API pages.

# 创建角色视频

> 通过账号限定的创作接口创建角色视频。

使用 `character_task_id` 加可选有序补充 `image_urls`，或直接用图片且第一张为主要角色。总数不超过 30 张。`mode` 支持 `motion`（默认）、`replace` 与 `recreate`。motion 与 replace 需二选一参考视频来源：`video_url` 或本人成功的 `video_task_id`；`recreate` 需要编译提示词与参考图，不带参考视频。

* 服务地址为 `https://omnimux.ai`，使用限定权限个人凭据，不使用 `sk-` 网关密钥。
* 所需权限：`influencer_creation:write`.
* `New-Api-User` 只作可选兼容信息。账号由凭据确定，此请求头不能选择其他归属。

新增权限须重新明确完成设备授权；已有和旧式凭据不会自动扩权。见[设备码登录](https://docs.omnimux.ai/zh/api-reference/account/device-login.md)。

> [!NOTE]
>
> 200 代表已持久受理排队或恢复，不代表成片或扣费确认。生成沿用账号积分/订阅额度。原生执行阶段对额度不足采用需要额度（402）的语义，但此受理入口不会同步返回 402；排队后仍可能失败。请查询任务状态和公开失败原因。motion 与 replace 不承诺生成前精确报价；`recreate` 是例外，精确金额来自拆解结果。

未知顶层请求字段返回 400。不要传入 `model`、`group`、`seed`、`size`。motion 与 replace 不接受 `duration_sec`（会被忽略）；`recreate` 必须原样传入拆解结果中的时长。使用同一账号的相同 `request_id` 与内容恢复原任务；改内容返回 409，恢复过期返回 410。生成开关关闭时新请求返回 503 `influencer_creation_disabled`，已受理请求的原样恢复和本人读取仍可使用。

后台在受理生成前识别真实时长（4–30 秒）、画幅、帧率、尺寸、编码及声音。支持 MP4/MOV、H.264/HEVC；24–60 帧/秒；每边 300–6000 像素；总像素 407696–8295044；来源宽高比 0.4–2.5。不合格素材直接拒绝，不悄悄裁剪或补时。`recreate` 不在这里检查参考视频：4–15 秒的参考已在拆解阶段校验。

| 清晰度 | 支持的输出画幅 |
| - | - |
| `480p` | `16:9`, `9:16`, `3:4` |
| `720p` | `16:9`, `9:16` |

默认 `motion`、`480p`。动作迁移明确画幅优先；省略时使用受支持的来源画幅，否则 `9:16`。对象交换保持受支持的来源画幅，冲突时拒绝。

## 爆款复刻模式

`mode: "recreate"` 提交的是[拆解复刻参考视频](https://docs.omnimux.ai/zh/api-reference/account/influencer/recreate-analyze.md)的结果：参考视频已经拆解完成，不会随本次请求再传。

* 不要传 `video_url` 与 `video_task_id`；传入任何一个都会返回 400。
* `prompt` 必填：轮询返回的编译提示词，可在 4000 字符上限内编辑。
* `image_urls` 必填：与拆解时相同顺序的图片，复刻为 1–9 张；`image_urls[0]` 为主要主体。
* `duration_sec` 必填：原样传入 analyze 返回的 `meta.duration_sec`。服务端只校验 4–15 整秒范围，超出返回 400；范围内其他值会成为输出时长，而编译提示词是按拆解时长写的，因此请原样传入。
* `aspect_ratio` 固定 `9:16`：可省略或传 `9:16`，其他明确值返回 400。
* `resolution` 为 `480p` 或 `720p`；`meta.pricing` 已给出该推导时长下两档清晰度的精确积分。

爆款复刻是唯一提供生成前精确报价的模式：`meta.pricing` 中的金额就是预扣会实际扣除的金额，请直接展示，不要自行估算。受理、任务轮询与成品契约保持不变；成片仍需核对实际时长与画幅。

```bash cURL 复刻生成 theme={null}
curl --request POST \
  --url 'https://omnimux.ai/api/influencer/v1/videos' \
  --header 'Authorization: Bearer <user-access-token>' \
  --header 'Content-Type: application/json' \
  --data '{"request_id":"creator-video-0002","mode":"recreate","prompt":"<analyze 返回的编译提示词>","image_urls":["https://omnimux.ai/REPLACE_WITH_PRODUCT_IMAGE_1.png"],"duration_sec":11,"aspect_ratio":"9:16","resolution":"720p"}'
```

请求保留图片顺序、传入参考原声，并沿用已存角色的人物/猫/狗类型。成片仍须核对外观、动作、画面和声音，任务成功本身不代表创作效果验收通过。

motion 与 replace 的 4–30 秒限制针对参考视频，不保证生成成片具有完全相同的时长。成片时长可能不同，已观察到4秒参考及请求返回约3.71秒成片。`duration_sec`是后台推导的整数请求秒数，不是成片实测时长。参考原声会传入生成，但成片音量可能变化，不承诺无损或逐个音频采样完全相同。请检查下载成片的实际时长和声音。爆款复刻的参考视频为 4–15 秒，其取整长度决定 `duration_sec`，成片同样需要核对。

```bash cURL theme={null}
curl --request POST \
  --url 'https://omnimux.ai/api/influencer/v1/videos' \
  --header 'Authorization: Bearer <user-access-token>' \
  --header 'Content-Type: application/json' \
  --data '{"request_id":"creator-video-0001","character_task_id":"task_example_character","video_url":"https://omnimux.ai/REPLACE_WITH_OWN_REFERENCE.mp4","mode":"motion","resolution":"480p"}'
```

```json 200 仅示例 theme={null}
{
  "success": true,
  "data": {
    "request_id": "creator-video-0001",
    "task_id": "task_example_video",
    "kind": "video",
    "status": "waiting",
    "raw_status": "WAITING",
    "artifact_status": "pending",
    "input": {},
    "recovery_expires_at": 0,
    "created_at": 1792000000,
    "finished_at": 0,
    "artifacts": [],
    "replayed": false
  }
}
```

```json 400 theme={null}
{
  "success": false,
  "code": "invalid_request",
  "message": "产品参数、未知请求字段或素材规格不符合要求。"
}
```

```json 401 theme={null}
{
  "success": false,
  "code": "AUTH_UNAUTHORIZED",
  "message": "需要有效账号凭据；过期、已撤销或被停用账号的凭据会被拒绝。"
}
```

```json 403 theme={null}
{
  "success": false,
  "code": "ACCESS_TOKEN_SCOPE_DENIED",
  "message": "缺少明确的创作读取/生成权限；旧凭据不会自动扩权。"
}
```

```json 404 theme={null}
{
  "success": false,
  "code": "task_not_found",
  "message": "未找到本人可用任务、角色或请求；不会透露其他账号的资源是否存在。"
}
```

```json 408 theme={null}
{
  "success": false,
  "code": "reference_video_invalid",
  "message": "参考素材准备超时或被取消；如果受理结果不明，重试前先按请求编号恢复。"
}
```

```json 409 theme={null}
{
  "success": false,
  "code": "creation_request_conflict",
  "message": "同一账号的请求编号已有不同创作内容；不要自动换号再次生成。"
}
```

```json 410 theme={null}
{
  "success": false,
  "code": "creation_request_expired",
  "message": "已超过恢复期或保留任务不可用；编号仍被保留，不能据此新建第二笔生成。"
}
```

```json 500 theme={null}
{
  "success": false,
  "code": "internal_error",
  "message": "无法准备本次创作。"
}
```

```json 503 theme={null}
{
  "success": false,
  "code": "influencer_creation_disabled",
  "message": "new command-line creations are currently disabled; accepted requests remain recoverable"
}
```


## OpenAPI

````yaml openapi/ops/influencer/zh/creation.json POST /api/influencer/v1/videos
openapi: 3.1.0
info:
  title: OmniMux 角色与视频创作
  version: '1'
servers:
  - url: https://omnimux.ai
security:
  - accessToken: []
paths:
  /api/influencer/v1/videos:
    post:
      summary: 创建角色视频
      description: >-
        需要显式
        influencer_creation:write。有效网站会话可使用同一本人路由。未知顶层创作字段会被拒绝；调用方不能选择模型、供应商分组、尺寸或时长。mode=motion/replace
        需二选一参考来源，参考视频 4–30 秒；成片时长可能不同，参考原声会传入生成。mode=recreate
        需要拆解后的提示词与参考图，不带参考视频，duration_sec 等于 analyze 返回的
        meta.duration_sec（4–15），画幅固定 9:16。各模式都请核对下载成片。
      operationId: InfluencerCreateVideo
      parameters:
        - name: New-Api-User
          in: header
          required: false
          schema:
            type: string
          description: 可选兼容请求头，不参与身份验证或资源归属；后台从凭据确定账号。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoRequest'
            example:
              request_id: creator-video-0001
              character_task_id: task_example_character
              video_url: https://omnimux.ai/REPLACE_WITH_OWN_REFERENCE.mp4
              mode: motion
              resolution: 480p
      responses:
        '200':
          description: 已受理或恢复的任务，不代表已交付成品。
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    $ref: '#/components/schemas/Task'
                required:
                  - success
                  - data
              example:
                success: true
                data:
                  request_id: creator-video-0001
                  task_id: task_example_video
                  kind: video
                  status: waiting
                  raw_status: WAITING
                  artifact_status: pending
                  input: {}
                  recovery_expires_at: 0
                  created_at: 1792000000
                  finished_at: 0
                  artifacts: []
                  replayed: false
        '400':
          description: 产品参数、未知请求字段或素材规格不符合要求。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                code: invalid_request
                message: 产品参数、未知请求字段或素材规格不符合要求。
        '401':
          description: 需要有效账号凭据；过期、已撤销或被停用账号的凭据会被拒绝。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                code: AUTH_UNAUTHORIZED
                message: 需要有效账号凭据；过期、已撤销或被停用账号的凭据会被拒绝。
        '403':
          description: 缺少明确的创作读取/生成权限，或提交在入队前被余额预检拦截。余额不足不会创建任务，也不会扣费；旧凭据不会自动扩权。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                scope_denied:
                  value:
                    success: false
                    code: ACCESS_TOKEN_SCOPE_DENIED
                    message: 缺少明确的创作读取/生成权限；旧凭据不会自动扩权。
                insufficient_user_quota:
                  value:
                    success: false
                    code: insufficient_user_quota
                    message: Insufficient user quota
        '404':
          description: 未找到本人可用任务、角色或请求；不会透露其他账号的资源是否存在。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                code: task_not_found
                message: 未找到本人可用任务、角色或请求；不会透露其他账号的资源是否存在。
        '408':
          description: 参考素材准备超时或被取消；如果受理结果不明，重试前先按请求编号恢复。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                code: reference_video_invalid
                message: 参考素材准备超时或被取消；如果受理结果不明，重试前先按请求编号恢复。
        '409':
          description: 同一账号的请求编号已有不同创作内容；不要自动换号再次生成。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                code: creation_request_conflict
                message: 同一账号的请求编号已有不同创作内容；不要自动换号再次生成。
        '410':
          description: 已超过恢复期或保留任务不可用；编号仍被保留，不能据此新建第二笔生成。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                code: creation_request_expired
                message: 已超过恢复期或保留任务不可用；编号仍被保留，不能据此新建第二笔生成。
        '500':
          description: 无法准备本次创作。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                code: internal_error
                message: 无法准备本次创作。
        '503':
          description: 创作或读取暂不可用；也可能是新生成尚未启用、当前没有兼容能力，或计价/报价服务暂时不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                disabled:
                  value:
                    success: false
                    code: influencer_creation_disabled
                    message: >-
                      new command-line creations are currently disabled;
                      accepted requests remain recoverable
                route:
                  value:
                    success: false
                    code: creation_route_unavailable
                    message: a compatible creation route is currently unavailable
                records:
                  value:
                    success: false
                    code: generation_queue_unavailable
                    message: creation records are temporarily unavailable
                quote_unavailable:
                  value:
                    success: false
                    code: generation_quote_unavailable
                    message: >-
                      The pricing service is temporarily unavailable. Please try
                      again.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://omnimux.ai/api/influencer/v1/videos' \
              --header 'Authorization: Bearer <user-access-token>' \
              --header 'Content-Type: application/json' \
              --data '{"request_id":"creator-video-0001","character_task_id":"task_example_character","video_url":"https://omnimux.ai/REPLACE_WITH_OWN_REFERENCE.mp4","mode":"motion","resolution":"480p"}'
components:
  schemas:
    VideoRequest:
      type: object
      properties:
        request_id:
          type: string
          minLength: 8
          maxLength: 128
          pattern: ^[A-Za-z0-9._:-]{8,128}$
          example: creator-character-0001
        mode:
          type: string
          enum:
            - motion
            - replace
            - recreate
          default: motion
          description: motion 与 replace 需二选一参考视频来源；recreate 需要编译提示词与参考图，不带参考视频。
        duration_sec:
          type: integer
          minimum: 4
          maximum: 15
          description: >-
            仅 mode=recreate 使用：analyze 轮询返回的 meta.duration_sec 整秒时长，请原样传入；超出
            4–15 秒返回 400 invalid_request。motion/replace
            忽略该字段，时长仍由服务端从参考视频推导。服务端只校验范围，因此范围内非拆解时长的值会成为输出时长，而编译提示词是按拆解时长写的。
        character_task_id:
          type: string
          example: task_example_character
          description: 本人成功的角色主图编号；其图片会作为主要角色前置到 image_urls。此处不能填写多角度结果编号。
        image_urls:
          type: array
          maxItems: 30
          items:
            type: string
            format: uri
            pattern: ^https://
            maxLength: 2048
          description: >-
            保持顺序的角色/补充图片。有 character_task_id 时最多再加 29 张；否则至少一张，第一张为主要角色。总数为
            1–30。recreate 请与 analyze 请求保持相同顺序。
        video_url:
          type: string
          format: uri
          pattern: ^https://
          maxLength: 2048
          description: 与 video_task_id 二选一的参考来源；公开 HTTPS 视频。后台识别真实媒体，不接受调用方手填时长。
        video_task_id:
          type: string
          example: task_example_character
          description: 本人成功的角色视频任务，作为参考视频；与 video_url 互斥。
        resolution:
          type: string
          enum:
            - 480p
            - 720p
          default: 480p
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '3:4'
          description: >-
            480p 支持 16:9、9:16、3:4；720p 支持 16:9、9:16。motion
            明确值优先，省略则跟随受支持的来源画幅，否则 9:16。replace 保持受支持的来源画幅，拒绝冲突明确值。recreate 固定
            9:16，其他明确值会被拒绝。
        prompt:
          type: string
          maxLength: 4000
          description: >-
            motion/replace：可选的兼容动作/场景补充描述。recreate：必填，传入 analyze 轮询返回的编译提示词，最多
            4000 字符。参考原声与主要角色身份、物种仍属 motion 生成要求。
      required:
        - request_id
      additionalProperties: false
      allOf:
        - if:
            required:
              - mode
            properties:
              mode:
                const: recreate
          then:
            required:
              - prompt
              - image_urls
              - duration_sec
            properties:
              image_urls:
                minItems: 1
                maxItems: 9
            not:
              anyOf:
                - required:
                    - video_url
                - required:
                    - video_task_id
          else:
            allOf:
              - oneOf:
                  - required:
                      - video_url
                    not:
                      required:
                        - video_task_id
                  - required:
                      - video_task_id
                    not:
                      required:
                        - video_url
              - anyOf:
                  - required:
                      - character_task_id
                  - required:
                      - image_urls
                    properties:
                      image_urls:
                        minItems: 1
    Task:
      type: object
      properties:
        request_id:
          type: string
          description: 调用方恢复编号；无命令行回执的既有网页任务可能为空，与请求追踪编号不同。
        task_id:
          type: string
          example: task_example_character
        kind:
          type: string
          enum:
            - character
            - multiview
            - video
        status:
          type: string
          enum:
            - waiting
            - submitting
            - reconciling
            - queued
            - running
            - succeeded
            - failed
            - unknown
        raw_status:
          type: string
          description: 原生任务状态；自动处理请使用归一化后的 status。
        artifact_status:
          type: string
          enum:
            - pending
            - ready
            - unavailable
          description: ready 要求任务成功且存在可用成品。受理成功或成品数组为空不代表已交付。
        parent_task_id:
          type: string
          example: task_example_character
        input:
          $ref: '#/components/schemas/ProductInput'
        recovery_expires_at:
          type: integer
          format: int64
          minimum: 0
          description: 秒级时间戳；进行中或尚未建立结束恢复期限时为零。结束后可恢复七天；过期不允许重用请求编号。
        created_at:
          type: integer
          format: int64
        finished_at:
          type: integer
          format: int64
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
        replayed:
          type: boolean
          description: 创建、请求恢复及任务/成品详情会返回；角色投影不保证包含此字段。
        raw_quota:
          type: integer
          minimum: 0
          description: 已知的原生额度记录，不是积分：raw_quota ÷ 500000 = 美元。没有已知正数时省略。
        credits:
          type: number
          minimum: 0
          description: 已知 raw_quota ÷ 50000，不是生成前报价，也不是最终退款凭证。
        quota_status:
          type: string
          enum:
            - recorded
            - reconciling
          description: 失败任务的 reconciling 不代表积分已经退回。
        fail_reason:
          type: string
          description: >-
            可用时返回的公开失败原因，请结合状态判断。"Insufficient user quota"
            表示任务在执行或结算阶段因账户余额不足失败；失败说明不代表退款已经完成。
      required:
        - request_id
        - task_id
        - kind
        - status
        - raw_status
        - artifact_status
        - input
        - recovery_expires_at
        - created_at
        - finished_at
        - artifacts
    Error:
      type: object
      properties:
        success:
          type: boolean
          const: false
        code:
          type: string
        message:
          type: string
      required:
        - success
        - code
        - message
    ProductInput:
      type: object
      properties:
        tier:
          type: string
          enum:
            - normal
            - freak
            - total
            - cats
            - dogs
        selection:
          $ref: '#/components/schemas/Selection'
        brief:
          type: string
        image_url:
          type: string
        parent_task_id:
          type: string
          example: task_example_character
        mode:
          type: string
          enum:
            - motion
            - replace
            - recreate
        resolution:
          type: string
          enum:
            - 480p
            - 720p
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '3:4'
        duration_sec:
          type: integer
          description: >-
            由服务端从参考视频推导的整数生成时长；小数秒可能被取整。recreate 时回显来自 analyze 结果提交的
            duration_sec。不是创建入参、不是参考视频的精确时长，也不是成片实测时长。
        character_task_id:
          type: string
          example: task_example_character
        prompt:
          type: string
    Artifact:
      type: object
      properties:
        key:
          type: string
        type:
          type: string
          examples:
            - image
            - video
        mime_type:
          type: string
        content_url:
          type: string
          format: uri
          description: 短期签名成品地址；失效时重新查询成品入口。不要向该地址或其存储重定向转发账号凭据。
        video_metadata:
          type: object
          description: >-
            服务器观测到的生成成品视频媒体信息。历史任务和非视频成品不包含此对象。数值为尽力而为：duration
            取自容器，video_duration 当前与它相同，调用方仍须按自己的约束校验。
          properties:
            duration:
              type: number
              description: 容器时长，单位秒。
            video_duration:
              type: number
              description: 画面时长，单位秒。生成成品未完整解码，因此当前与 duration 相同。
            width:
              type: integer
              description: 宽度，单位像素。
            height:
              type: integer
              description: 高度，单位像素。
            frame_rate:
              type: number
              description: 帧率，单位帧/秒。
            video_codec:
              type: string
              description: 观测到的视频编码，例如 h264 或 hevc。
            audio_codec:
              type: string
              description: 观测到的音频编码；成品无音轨时为空字符串。
            container:
              type: string
              description: 容器格式，例如 mp4 或 mov。
            size_bytes:
              type: integer
              format: int64
              description: 已存储成品的字节数。
          required:
            - duration
            - video_duration
            - width
            - height
            - frame_rate
            - video_codec
            - audio_codec
            - container
            - size_bytes
      required:
        - key
        - type
        - content_url
    Selection:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
      description: >-
        类别编号到有序选项编号数组的映射；请使用创作选项返回的
        taxonomy。这是对象，不是平铺数组。未知类别或选项、冲突组合会被拒绝；沿用角色类型可见性与现有选项规范化规则。
      example:
        gender:
          - female
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      bearerFormat: nap_
      description: >-
        OmniMux 限定权限个人凭据；每个操作标明准确的 influencer_creation 权限。旧凭据不会自动扩权，不使用 sk-
        网关密钥；网页会话沿用既有账号验证。

````

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