# MiniMax-H3-Context-IR Multimodal Prompt Enhancement

> Video Generation

Submit an asynchronous prompt enhancement task. The `input.content` must contain exactly one non-empty text item; the model will automatically select the processing mode based on other media items and their `role`.

Supported input combinations:
- Text-to-video prompt: Contains only one `text` item.
- Image-to-video prompt: `text` plus one first-frame or last-frame image, or both first and last frames.
- Multimodal reference prompt: `text` plus a combination of reference images, reference videos, and reference audio.

Image-to-video and multimodal reference are mutually exclusive and cannot be mixed in the same request.

**Input Media Limitations** (Total request body size ≤ 64 MB; use public URLs for large files, do not use Base64):

**Image (image_url)**:
| Item | Limit |
|:---|:---|
| Format | JPG, JPEG, PNG, WEBP, HEIC, HEIF |
| Single file size | ≤ 30 MB |
| Width/Height range | [256, 5760] px |
| Aspect ratio (W/H) | [0.4, 2.5] |
| Quantity | First frame ≤ 1, Last frame ≤ 1, Reference images ≤ 9 |

**Video (video_url)** (Multimodal reference only):
| Item | Limit |
|:---|:---|
| Container / Format | MP4 (.mp4), MOV (.mov) |
| Encoding | Video: H.264/AVC, H.265/HEVC; Audio: AAC, MP3 |
| Single file size | ≤ 50 MB |
| Count | ≤ 3 |
| Duration per clip | [2, 15] s; Total duration ≤ 15 s |
| Width/Height range | [256, 5760] px |
| Aspect ratio (W/H) | [0.4, 2.5] |
| Frame rate | [23.976, 60] |

**Audio (audio_url)** (Multimodal reference only):
| Item | Limit |
|:---|:---|
| Format | WAV, MP3 |
| Single file size | ≤ 15 MB |
| Count | ≤ 3 |
| Duration per clip | [2, 15] s; Total duration ≤ 15 s |

## Endpoint

`POST https://api.modelverse.cn/v1/tasks/submit`

## Request Body

## Responses

- **200** — Task submitted successfully.
- **400** — Invalid request parameters or input combination.
- **default** — Error response.

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "MiniMax-H3-Context-IR Multimodal Prompt Enhancement API Documentation",
    "version": "1.0.0",
    "description": "This is the API documentation for the `MiniMax-H3-Context-IR` multimodal prompt enhancement service on ModelVerse. It generates structured, semantically rich video prompts through multimodal context (text + image/video/audio).\n\n**Important Note**: This API only returns enhanced video prompts and does not create video generation tasks. The enhanced prompts can be used as input for standard video generation APIs (such as `MiniMax-H3`).\n\nAPI endpoints include `POST /v1/tasks/submit` and `GET /v1/tasks/status`.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint used in this documentation."
    }
  ],
  "tags": [
    {
      "name": "MiniMax-H3-Context-IR",
      "description": "MiniMax-H3-Context-IR multimodal prompt enhancement tasks."
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "MiniMax-H3-Context-IR"
        ],
        "operationId": "submitMiniMaxH3ContextIRTask",
        "summary": "MiniMax-H3-Context-IR Multimodal Prompt Enhancement",
        "description": "Submit an asynchronous prompt enhancement task. The `input.content` must contain exactly one non-empty text item; the model will automatically select the processing mode based on other media items and their `role`.\n\nSupported input combinations:\n- Text-to-video prompt: Contains only one `text` item.\n- Image-to-video prompt: `text` plus one first-frame or last-frame image, or both first and last frames.\n- Multimodal reference prompt: `text` plus a combination of reference images, reference videos, and reference audio.\n\nImage-to-video and multimodal reference are mutually exclusive and cannot be mixed in the same request.\n\n**Input Media Limitations** (Total request body size ≤ 64 MB; use public URLs for large files, do not use Base64):\n\n**Image (image_url)**:\n| Item | Limit |\n|:---|:---|\n| Format | JPG, JPEG, PNG, WEBP, HEIC, HEIF |\n| Single file size | ≤ 30 MB |\n| Width/Height range | [256, 5760] px |\n| Aspect ratio (W/H) | [0.4, 2.5] |\n| Quantity | First frame ≤ 1, Last frame ≤ 1, Reference images ≤ 9 |\n\n**Video (video_url)** (Multimodal reference only):\n| Item | Limit |\n|:---|:---|\n| Container / Format | MP4 (.mp4), MOV (.mov) |\n| Encoding | Video: H.264/AVC, H.265/HEVC; Audio: AAC, MP3 |\n| Single file size | ≤ 50 MB |\n| Count | ≤ 3 |\n| Duration per clip | [2, 15] s; Total duration ≤ 15 s |\n| Width/Height range | [256, 5760] px |\n| Aspect ratio (W/H) | [0.4, 2.5] |\n| Frame rate | [23.976, 60] |\n\n**Audio (audio_url)** (Multimodal reference only):\n| Item | Limit |\n|:---|:---|\n| Format | WAV, MP3 |\n| Single file size | ≤ 15 MB |\n| Count | ≤ 3 |\n| Duration per clip | [2, 15] s; Total duration ≤ 15 s |\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MiniMaxH3ContextIRSubmitRequest"
              },
              "examples": {
                "textToVideo": {
                  "summary": "Text-to-video prompt",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "An orange cat stretching in the sunlight, its fur sparkling"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 6,
                      "ratio": "16:9"
                    }
                  }
                },
                "firstFrame": {
                  "summary": "First-frame image-to-video prompt",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "Make the scene in the image come alive with a gentle breeze"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/scene.jpg"
                          },
                          "role": "first_frame"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 8,
                      "ratio": "16:9"
                    }
                  }
                },
                "firstAndLastFrame": {
                  "summary": "First-and-last-frame image-to-video prompt",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "Create a gradient video of this ink painting"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/start.jpg"
                          },
                          "role": "first_frame"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/end.jpg"
                          },
                          "role": "last_frame"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 10,
                      "ratio": "16:9"
                    }
                  }
                },
                "referenceImageAndAudio": {
                  "summary": "Multimodal reference prompt (image + audio)",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "Reference the image style and background music to create a sci-fi scene"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/style.jpg"
                          },
                          "role": "reference_image"
                        },
                        {
                          "type": "audio_url",
                          "audio_url": {
                            "url": "https://example.com/bgm.mp3"
                          },
                          "role": "reference_audio"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 10,
                      "ratio": "9:16"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task submitted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRSubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "Task submitted",
                    "value": {
                      "output": {
                        "task_id": "426586401755526",
                        "task_status": "Pending",
                        "submit_time": 1785702855
                      },
                      "request_id": "req_xxxxxxxxxxxxx"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or input combination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/MiniMaxH3ContextIRParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/MiniMaxH3ContextIRParamError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "MiniMax-H3-Context-IR"
        ],
        "operationId": "getMiniMaxH3ContextIRTaskStatus",
        "summary": "MiniMax-H3-Context-IR Prompt Enhancement Task Status",
        "description": "Query the asynchronous task status. Upon success, `output.result.prompt` will contain the enhanced video prompt.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "The asynchronous task identifier returned by `/v1/tasks/submit`.",
            "schema": {
              "type": "string"
            },
            "example": "426586401755526"
          }
        ],
        "responses": {
          "200": {
            "description": "Task status response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRStatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "Successful task",
                    "value": {
                      "output": {
                        "task_id": "426586401755526",
                        "task_status": "Success",
                        "submit_time": 1785702855,
                        "finish_time": 1785702884,
                        "result": {
                          "prompt": "integrated_multimodal_description: [Shot 1] Cinematic, wide shot with a slow push in...\noverall_soundscape: Deep, resonant low-frequency...\nnon_diegetic_music: Symphonic orchestral score..."
                        }
                      },
                      "request_id": "req_def456"
                    }
                  },
                  "failure": {
                    "summary": "Failed task",
                    "value": {
                      "output": {
                        "task_id": "426586401755526",
                        "task_status": "Failure",
                        "submit_time": 1785702855,
                        "finish_time": 1785705540,
                        "error_message": "Task failed reason"
                      },
                      "request_id": "req_def456"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid task identifier or request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/MiniMaxH3ContextIRParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "Please include `Authorization: Bearer {your_api_key}` in the request header."
      }
    },
    "schemas": {
      "MiniMaxH3ContextIRSubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "minimax-h3-context-ir",
            "description": "Model name. Fixed to `minimax-h3-context-ir` in this documentation."
          },
          "input": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRInput"
          },
          "parameters": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRParameters"
          }
        }
      },
      "MiniMaxH3ContextIRInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "array",
            "minItems": 1,
            "description": "Multimodal input array. Must contain exactly one non-empty `text` item.\n\nSupported content types:\n- `text`: Text description (required, exactly one)\n- `image_url`: Image URL (first frame, last frame, or reference image)\n- `video_url`: Video URL (reference video)\n- `audio_url`: Audio URL (reference audio)\n\nImage roles: `first_frame`, `last_frame`, `reference_image`. Maximum 1 first frame and 1 last frame.\nVideo role: `reference_video`.\nAudio role: `reference_audio`.\n\nFirst/last frames and multimodal reference are mutually exclusive and cannot be mixed in the same request.\n",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRTextContent"
                },
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRImageContent"
                },
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRVideoContent"
                },
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRAudioContent"
                }
              ]
            }
          }
        }
      },
      "MiniMaxH3ContextIRTextContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "text"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 7000,
            "description": "Text prompt, required: All scenarios must include one non-empty text describing the desired video.\nLength is calculated by character count; single text maximum 7000 characters.\n"
          }
        }
      },
      "MiniMaxH3ContextIRImageContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "image_url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "image_url"
          },
          "image_url": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRURLObject"
          },
          "role": {
            "type": "string",
            "description": "Image role.",
            "enum": [
              "first_frame",
              "last_frame",
              "reference_image"
            ]
          }
        },
        "description": "Images only support public HTTP/HTTPS URLs, Base64 is not supported.\n"
      },
      "MiniMaxH3ContextIRVideoContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "video_url",
          "role"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "video_url"
          },
          "video_url": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRURLObject"
          },
          "role": {
            "type": "string",
            "const": "reference_video"
          }
        },
        "description": "For multimodal reference only. Supports video files via public URLs.\n"
      },
      "MiniMaxH3ContextIRAudioContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "audio_url",
          "role"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "audio_url"
          },
          "audio_url": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRURLObject"
          },
          "role": {
            "type": "string",
            "const": "reference_audio"
          }
        },
        "description": "For multimodal reference only. Supports audio files via public URLs.\n"
      },
      "MiniMaxH3ContextIRURLObject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://",
            "description": "Public HTTP/HTTPS URL accessible by MiniMax service; Base64 or data URLs are not supported."
          }
        }
      },
      "MiniMaxH3ContextIRParameters": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "duration"
        ],
        "properties": {
          "duration": {
            "type": "integer",
            "minimum": 4,
            "maximum": 15,
            "description": "Target video duration in seconds, required, integer.\nAvailable values: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15\n"
          },
          "ratio": {
            "type": "string",
            "default": "adaptive",
            "enum": [
              "adaptive",
              "21:9",
              "16:9",
              "4:3",
              "1:1",
              "3:4",
              "9:16"
            ],
            "description": "Target video aspect ratio, default is adaptive.\n\n**Text-to-video** (content contains only text): ratio is required and cannot be adaptive; available values: 21:9, 16:9, 4:3, 1:1, 3:4, 9:16.\n\n**Image-to-video** (content contains first_frame / last_frame images): Aspect ratio is determined by input images, ratio is always adaptive; other valid values will be accepted but ignored and treated as adaptive.\n\n**Multimodal reference** (content contains reference_image / reference_video / reference_audio): ratio is optional, default is adaptive; can also explicitly specify any of the above specific ratios.\n"
          },
          "callback_url": {
            "type": "string",
            "format": "uri",
            "description": "Status change callback URL (optional)."
          }
        }
      },
      "MiniMaxH3ContextIRSubmitResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "task_id",
              "task_status",
              "submit_time"
            ],
            "properties": {
              "task_id": {
                "type": "string",
                "description": "Unique asynchronous task identifier."
              },
              "task_status": {
                "type": "string",
                "description": "Task status.",
                "enum": [
                  "Pending"
                ]
              },
              "submit_time": {
                "type": "integer",
                "format": "int64",
                "description": "Task submission timestamp (Unix timestamp, seconds)."
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "MiniMaxH3ContextIRStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRStatusOutput"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "MiniMaxH3ContextIRStatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique asynchronous task identifier."
          },
          "task_status": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRTaskStatus"
          },
          "result": {
            "type": "object",
            "description": "Result returned when task succeeds.",
            "properties": {
              "prompt": {
                "type": "string",
                "description": "Enhanced video prompt containing the following sections:\n- `integrated_multimodal_description`: Shot description, composition, motion design, lighting effects\n- `overall_soundscape`: Ambient sound, atmospheric audio description\n- `non_diegetic_music`: Music style, emotional description\n"
              }
            }
          },
          "submit_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task submission timestamp (Unix timestamp, seconds)."
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task completion timestamp (Unix timestamp, seconds)."
          },
          "error_message": {
            "type": "string",
            "description": "Error message returned when task fails."
          }
        }
      },
      "MiniMaxH3ContextIRTaskStatus": {
        "type": "string",
        "description": "Asynchronous task status.",
        "enum": [
          "Pending",
          "Running",
          "Success",
          "Failure"
        ]
      },
      "MiniMaxH3ContextIRErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorObject"
          }
        }
      },
      "MiniMaxH3ContextIRErrorObject": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "message",
          "type"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message."
          },
          "type": {
            "type": "string",
            "description": "Error type."
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error code."
          },
          "param": {
            "type": [
              "string",
              "null"
            ],
            "description": "Related request parameter, if any."
          }
        }
      }
    },
    "examples": {
      "MiniMaxH3ContextIRParamError": {
        "summary": "Parameter error",
        "value": {
          "error": {
            "message": "input.content must contain exactly one non-empty text item",
            "type": "invalid_request_error",
            "code": "param_error",
            "param": "input.content"
          }
        }
      }
    }
  }
}
```
