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

# MiniMax-H3 Character Replace

> Replace the main person in a guide video with the person from your photo — face, hair, body and outfit. The original scene, camera motion, movement and audio track are kept.

By default the output follows the guide video's length, rounded down to whole seconds (a 14.6-second video gives a 14-second result). The guide video must be at least 5 seconds long; videos longer than 15 seconds are rejected unless you pass `duration`, which renders only their first N seconds. The aspect ratio follows the guide video.

If you don't pass `swap_details`, the photo is described automatically and that description is used to transfer the outfit. In videos with several people, use `swap_target` to say which one to replace.

**Tips** — a clear, front-facing half-body or full-body photo of a single person works best. Everything else in the frame is kept as-is, including any logos, watermarks or text in the original video.

**Pricing** — per second of generated video, in tokens (USD at $0.02/token):

| resolution | tokens/s | USD/s | per 5s |
|---|---|---|---|
| 720p | 2 | $0.04 | $0.20 |

Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use `custom_callback_url`) to get the generated video.



## OpenAPI

````yaml api-reference/video-generations/openapi-minimax-h3-swap.json POST /api/v1/videos/generations
openapi: 3.1.0
info:
  title: GoEnhance API - MiniMax H3 Character Replace
  description: Replace the main person in a video with the person from a photo.
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/videos/generations:
    post:
      tags:
        - VideoGenerations
      summary: MiniMax H3 Character Replace
      description: >-
        Replace the main person in a guide video with the person from your photo
        — face, hair, body and outfit. The original scene, camera motion,
        movement and audio track are kept.


        By default the output follows the guide video's length, rounded down to
        whole seconds (a 14.6-second video gives a 14-second result). The guide
        video must be at least 5 seconds long; videos longer than 15 seconds are
        rejected unless you pass `duration`, which renders only their first N
        seconds. The aspect ratio follows the guide video.


        If you don't pass `swap_details`, the photo is described automatically
        and that description is used to transfer the outfit. In videos with
        several people, use `swap_target` to say which one to replace.


        **Tips** — a clear, front-facing half-body or full-body photo of a
        single person works best. Everything else in the frame is kept as-is,
        including any logos, watermarks or text in the original video.


        **Pricing** — per second of generated video, in tokens (USD at
        $0.02/token):


        | resolution | tokens/s | USD/s | per 5s |

        |---|---|---|---|

        | 720p | 2 | $0.04 | $0.20 |


        Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use
        `custom_callback_url`) to get the generated video.
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Authorization}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - minimax-h3-swap
                  description: Model name. Must be `minimax-h3-swap`.
                image_url:
                  type: string
                  format: uri
                  description: >-
                    Publicly accessible URL of the person photo (max 10 MB).
                    This person replaces the main person in the video. A clear,
                    front-facing half-body or full-body photo of a single person
                    works best.
                video_url:
                  type: string
                  format: uri
                  description: >-
                    Publicly accessible URL of the guide video (max 100 MB, at
                    least 5 seconds). Its main person is replaced; the scene,
                    camera motion, movement and audio are kept. Videos longer
                    than 15 seconds are rejected unless you pass `duration`.
                duration:
                  type: integer
                  minimum: 5
                  maximum: 15
                  description: >-
                    Optional. Render only the first N seconds of the guide video
                    (5–15). Omit it to follow the video's length, rounded down
                    to whole seconds. Must not exceed the actual video length —
                    a longer value is rejected rather than silently clamped.
                    Billing follows the output length.
                resolution:
                  type: string
                  enum:
                    - 480p
                    - 720p
                  default: 720p
                  description: >-
                    Optional. Accepted values are `480p` and `720p`; the video
                    is always generated at 720p, at the same price. The aspect
                    ratio follows the guide video.
                swap_target:
                  type: string
                  maxLength: 600
                  description: >-
                    Optional. In videos with several people, which person to
                    replace. Describe them by position or action (for example
                    "the man on the left" or "the player kicking the ball"), not
                    by clothing. Longer text is truncated to 600 characters.
                swap_details:
                  type: string
                  maxLength: 800
                  description: >-
                    Optional. An appearance description of the person in the
                    photo, head to toe (for example "East Asian woman, long
                    black hair, white T-shirt, blue jeans, white sneakers"). If
                    omitted, the photo is described automatically. Longer text
                    is truncated to 800 characters.
                custom_callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. A publicly accessible HTTPS URL. When the task
                    status changes (processing / success / failed), GoEnhance
                    sends a POST request to this URL. The request body is
                    identical to the response of GET /api/v1/jobs/detail. If
                    your server does not respond with HTTP 200, the notification
                    is retried up to 3 times, with a 3-second timeout per
                    attempt.
                  example: https://your-server.com/goenhance/callback
              required:
                - model
                - image_url
                - video_url
            example:
              model: minimax-h3-swap
              image_url: >-
                https://cdn.goenhance.ai/user/goenhance/76115ad445ce26fbd5ad2c649a29e806.jpg
              video_url: >-
                https://cdn.goenhance.ai/user/upload-data/video-to-video/333768e610e442d02e8030693def0b6e.mp4
              swap_target: the person in the center of the frame
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                      cost:
                        type: number
                        description: >-
                          Tokens deducted for this request. This is the amount
                          actually charged, so it already reflects any discount
                          active on your account and can be lower than the
                          listed price. Tokens are deducted when the task is
                          accepted, and refunded automatically if the generation
                          ends in failure.
                        example: 28
                    required:
                      - img_uuid
                      - cost
                required:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                      cost: 28
                '2':
                  summary: Invalid duration
                  value:
                    code: -1
                    msg: duration (15s) exceeds the video length (12.0s).
                '3':
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
                long:
                  summary: Video longer than 15s without duration
                  value:
                    code: -1
                    msg: >-
                      Video is 20s. Pass duration (max 15s) to use its first
                      part.
                quota:
                  summary: API key quota exceeded
                  value:
                    code: 101
                    msg: 'API key quota exceeded: 4990 of 5000 tokens used (monthly)'
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
          headers: {}
      deprecated: false
      security: []

````

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