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

# MiniMax-H3 Regeneration

>  - Regenerate MiniMax-H3 768P video into 2K
- Prefer source_task_id only; the platform auto-fills prompt, media, and source video
- Not generic upscaling: source must be an H3 768P output
- Per-second billing ($0.045/s output + same rate for reference videos) 

<Info>
  **Full 2K Workflow** (optional): ① [Context-IR](/ko/api-reference/videos/minimax-h3/context-ir) → ② [MiniMax-H3](/ko/api-reference/videos/minimax-h3/generation) with `resolution: "768P"` → ③ this endpoint to 2K.\
  `768P unit price + regeneration unit price = direct 2K unit price`, with cheaper iteration.
</Info>

<Warning>
  **Not a generic upscaler.** The source must be a **768P video produced by MiniMax-H3**. External videos (phone clips, other models, downloads) will be rejected.
</Warning>

## Recommended: `source_task_id` only

Pass only the `task_id` of a **successful MiniMax-H3 · 768P** job. The server fills in the rest.

```json theme={null}
{
  "model": "MiniMax-H3-Regeneration",
  "source_task_id": "task_01J9HA7J*************"
}
```

`source_task_id` must satisfy all of the following, or you get a **sync 400** (no task, no charge):

| Rule                  | Notes                              |
| --------------------- | ---------------------------------- |
| Owned by your account | Cannot upgrade another user’s task |
| Model is `MiniMax-H3` | Not other models                   |
| Status is successful  | Task is `completed`                |
| Resolution is `768P`  | Must be a 768P preview output      |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "MiniMax-H3-Regeneration",
      "source_task_id": "task_01J9HA7J*************"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.apimart.ai/v1/videos/generations"

  payload = {
      "model": "MiniMax-H3-Regeneration",
      "source_task_id": "task_01J9HA7J*************",
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.apimart.ai/v1/videos/generations";

  const payload = {
    model: "MiniMax-H3-Regeneration",
    source_task_id: "task_01J9HA7J*************",
  };

  const headers = {
    Authorization: "Bearer <token>",
    "Content-Type": "application/json",
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload),
  })
    .then((response) => response.json())
    .then((data) => console.log(data))
    .catch((error) => console.error("Error:", error));
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "status": "submitted",
        "task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed, please check your API key",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient account balance, please top up and try again",
      "type": "payment_required"
    }
  }
  ```
</ResponseExample>

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer Token auth. Get a key from the [API Key Management Page](https://apimart.ai/keys).

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Request Parameters

<ParamField body="model" type="string" required>
  Fixed value: `MiniMax-H3-Regeneration`
</ParamField>

<ParamField body="source_task_id" type="string" required>
  ID of a **successful MiniMax-H3 · 768P** task on this platform.

  When set, you do **not** need `prompt`, source video, or reference media — the server fills them.
</ParamField>

## Source Video Specs

The source must match MiniMax-H3 768P output:

| Item           | Requirement                                    |
| -------------- | ---------------------------------------------- |
| Audio track    | **Required**; silent video not supported       |
| Frame rate     | 24 fps                                         |
| Width / height | Each divisible by 32                           |
| Area           | ≤ 768 × 1344 (1,032,192 pixels)                |
| Frame count    | 107\~362 frames, steps of 17 (~~4~~15 seconds) |

Spec failures fail the task with a reason and refund.

## Billing

Per second (same structure as H3 generation, different unit prices):

| Item                  | Price                                   |
| --------------------- | --------------------------------------- |
| Output (768P → 2K)    | **\$0.045 / s**                         |
| Input reference video | **\$0.045 / s**                         |
| Input images          | First 5 free, then **\$0.0225 / image** |
| Input audio           | Free                                    |

```
Total = 0.045 × (source duration + reference video duration) + 0.0225 × max(0, image_count - 5)
```

> Media from the original 768P job is **billed again** on regeneration — not output seconds only.

**Examples**

| Scenario                            | Cost                    |
| ----------------------------------- | ----------------------- |
| 5s source, no extra media           | \$0.225                 |
| 10s source + 2 images               | \$0.45 (images ≤5 free) |
| 6s source + 8s ref video + 7 images | \$0.675                 |

With `source_task_id`, pre-charge uses the original task’s real output seconds.

## Request Examples

### source\_task\_id

```json theme={null}
{
  "model": "MiniMax-H3-Regeneration",
  "source_task_id": "task_01J9HA7J*************"
}
```

## Common Errors

Submit-time parameter errors are sync **400** (no task, no charge):

| Case                     | Notes                                                  |
| ------------------------ | ------------------------------------------------------ |
| Invalid `source_task_id` | Not yours / not MiniMax-H3 / not successful / not 768P |

Failed tasks are auto-refunded.

## Response

<ResponseField name="code" type="integer">
  Status code; 200 on success
</ResponseField>

<ResponseField name="data" type="array">
  On submit: `status` / `task_id`; when complete, result is in `result.videos` (same as normal video jobs)

  <Expandable title="Array elements">
    <ResponseField name="status" type="string">
      Initially `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      Task ID for [status queries](/ko/api-reference/tasks/status)
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  Poll [Get Task Status](/ko/api-reference/tasks/status). On success use `result.videos[0].url`.
</Note>
