> ## 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.

# 创建角色

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

默认 `normal` 为普通人物，其他类型为 `freak`、`total`、`cats`、`dogs`。人物类型至少提供有效特征、描述或风格参考图之一。角色主图保留固定的 16:9 双视图构图。

角色主图是一张横向双视图设定图，实际像素以下载文件为准。角色描述最多4000字符；输入不符合适用要求时会明确报错。

* 服务地址为 `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；排队后仍可能失败。请查询任务状态和公开失败原因；不承诺视频生成前的精确报价。

未知顶层请求字段返回 400。不要传入 `model`、`group`、`seed`、`size` 或手填时长。使用同一账号的相同 `request_id` 与内容恢复原任务；改内容返回 409，恢复过期返回 410。生成开关关闭时新请求返回 503 `influencer_creation_disabled`，已受理请求的原样恢复和本人读取仍可使用。

`selection` 是 `{"gender":["female"]}` 这样的对象，不是数组。请从[创作选项](https://docs.omnimux.ai/zh/api-reference/account/influencer/options.md)读取当前编号及可见性。可选风格图支持 JPEG、PNG、WebP，最多 5 MiB。

```bash cURL theme={null}
curl --request POST \
  --url 'https://omnimux.ai/api/influencer/v1/characters' \
  --header 'Authorization: Bearer <user-access-token>' \
  --header 'Content-Type: application/json' \
  --data '{"request_id":"creator-character-0001","tier":"normal","brief":"A friendly adult character","selection":{"gender":["female"]}}'
```

```json 200 仅示例 theme={null}
{
  "success": true,
  "data": {
    "request_id": "creator-character-0001",
    "task_id": "task_example_character",
    "kind": "character",
    "status": "waiting",
    "raw_status": "WAITING",
    "artifact_status": "pending",
    "input": {
      "tier": "normal",
      "selection": {},
      "brief": "A friendly adult character"
    },
    "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 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/characters
openapi: 3.1.0
info:
  title: OmniMux 角色与视频创作
  version: '1'
servers:
  - url: https://omnimux.ai
security:
  - accessToken: []
paths:
  /api/influencer/v1/characters:
    post:
      summary: 创建角色
      description: >-
        需要明确的 influencer_creation:write
        权限；有效网页会话也可使用同一归属受限入口。创建请求拒绝未知顶层字段；调用方不能选择模型、供应商分组、尺寸或手填时长。
        后台按1920x1088请求一张横向双视图角色设定图；成品实际像素可能不同，以下载文件为准。角色描述最多4000字符。
      operationId: InfluencerCreateCharacter
      parameters:
        - name: New-Api-User
          in: header
          required: false
          schema:
            type: string
          description: 可选兼容请求头，不参与身份验证或资源归属；后台从凭据确定账号。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CharacterRequest'
            example:
              request_id: creator-character-0001
              tier: normal
              brief: A friendly adult character
              selection:
                gender:
                  - female
      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-character-0001
                  task_id: task_example_character
                  kind: character
                  status: waiting
                  raw_status: WAITING
                  artifact_status: pending
                  input:
                    tier: normal
                    selection: {}
                    brief: A friendly adult character
                  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
        '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/characters' \
              --header 'Authorization: Bearer <user-access-token>' \
              --header 'Content-Type: application/json' \
              --data '{"request_id":"creator-character-0001","tier":"normal","brief":"A friendly adult character","selection":{"gender":["female"]}}'
components:
  schemas:
    CharacterRequest:
      type: object
      properties:
        request_id:
          type: string
          minLength: 8
          maxLength: 128
          pattern: ^[A-Za-z0-9._:-]{8,128}$
          example: creator-character-0001
          description: 必填、区分大小写、按账号隔离的恢复编号。同号同内容返回原任务，改内容返回 409。
        tier:
          type: string
          enum:
            - normal
            - freak
            - total
            - cats
            - dogs
          default: normal
          description: normal：普通人物；freak：风格化人物；total：夸张人物；cats/dogs：拟人猫/狗。
        selection:
          $ref: '#/components/schemas/Selection'
        brief:
          type: string
          maxLength: 4000
          description: 外观与服装描述，保留固定双视图构图。人物类型至少提供一个有效选项、描述或风格参考图。
        image_url:
          type: string
          format: uri
          pattern: ^https://
          maxLength: 2048
          description: 可选风格参考图，JPEG/PNG/WebP，最多 5 MiB。必须能公开读取，并通过既有图片检查。
      required:
        - request_id
      additionalProperties: false
    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
    Selection:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
      description: >-
        类别编号到有序选项编号数组的映射；请使用创作选项返回的
        taxonomy。这是对象，不是平铺数组。未知类别或选项、冲突组合会被拒绝；沿用角色类型可见性与现有选项规范化规则。
      example:
        gender:
          - female
    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
  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.