MiniMax H3 Image Editing
Endpoint
POST /jobs/createTask
Full URL: https://modelfold.ai/v1/jobs/createTask
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Edit or compose images from 1–16 reference images with MiniMax-H3-Image. Refer to the images in the prompt as <Picture 1>, <Picture 2>, … in upload order.
Prompt expansion is on by default; we recommend keeping it on for better image quality.
Reference images
- 1–16 publicly downloadable
http(s)://image URLs, each ≤ 20 MB and ≤ 64 MP; JPG / PNG / WEBP / HEIC / BMP (transparent backgrounds are filled with white) - More or larger reference images make generation slower; resizing them so the short side is about 1024 px helps
Output size
Tier + ratio — resolution (default 2K) sets the size tier and aspect_ratio sets the shape. auto follows the aspect ratio of the first reference image (any ratio between 1:3 and 3:1), so the output size may not match the table below.
| Aspect ratio | 1K | 2K | 4K |
|---|---|---|---|
| 1:1 | 1024×1024 | 2048×2048 | 4096×4096 |
| 5:4 / 4:5 | 1152×912 / 912×1152 | 2304×1824 / 1824×2304 | 4576×3648 / 3648×4576 |
| 4:3 / 3:4 | 1184×880 / 880×1184 | 2368×1760 / 1760×2368 | 4736×3552 / 3552×4736 |
| 3:2 / 2:3 | 1248×832 / 832×1248 | 2496×1664 / 1664×2496 | 5024×3360 / 3360×5024 |
| 16:9 / 9:16 | 1360×768 / 768×1360 | 2720×1536 / 1536×2720 | 5472×3072 / 3072×5472 |
| 21:9 | 1568×672 | 3136×1344 | 6272×2688 |
Custom size — width and height in pixels (1–8192 each), e.g. width: 1920, height: 1080. Total pixels 655,360–20,000,000, width : height between 1:3 and 3:1; the output is exactly this size. When using them, do not pass resolution or aspect_ratio — this combination is not accepted.
Which one applies
|---|---| | Only one of them | Not allowed: width and height must be set together | | Neither | resolution (default 2K) and aspect_ratio (default auto) apply | | width/height together with resolution or aspect_ratio | Not allowed: the request is rejected |
- One image per task, PNG (default) or JPEG
- Result URLs expire after about 14 days — download and store them if you need them longer
Query Task Status
After submitting a task with model=minimax-h3/image-edit, use the unified query endpoint to check progress and retrieve results:
- Get Task Details — Learn how to query task status and retrieve generation results
TIP
For production use, we recommend using the callBackUrl parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.
Related Resources
- Market Overview — Explore all available models
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name to use for generation. Required field. - Must be minimax-h3/image-edit for this endpoint Default:"minimax-h3/image-edit"。 Allowed values:minimax-h3/image-edit。 Example:minimax-h3/image-edit。 |
callBackUrl | string | No | The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see Webhook Verification Guide for signature verification implementation Example: https://your-domain.com/api/callback。 |
input | object | Yes | Input parameters for the generation task |
input.prompt | string | Yes | Required. Editing instruction, 1–5000 characters; Chinese and English are both supported. Refer to reference images as <Picture 1>, <Picture 2>, … (in image_urls order). minLength: 1. maxLength: 5000. Example:Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.。 |
input.aspect_ratio | string | No | Aspect ratio of the output image. Optional, defaults to auto.- auto: follows the aspect ratio of the first reference image (any ratio between 1:3 and 3:1)- Output sizes for each ratio and tier are listed in the description above - Do not pass together with width/height Allowed values:auto / 1:1 / 5:4 / 4:3 / 3:2 / 16:9 / 21:9 / 4:5 / 3:4 / 2:3 / 9:16。 Example:auto。 |
input.seed | integer | No | Random seed, 0–2147483647. Optional; a random seed is used when omitted, and the actual seed is returned with the result. With prompt expansion on, the rewritten prompt differs each time, so results are only reproducible when expand_prompt is false. minimum: 0. maximum: 2147483647. Example:7。 |
input.expand_prompt | boolean | No | Whether to rewrite the prompt into a detailed English description before generating. Optional. Prompt expansion is on by default; we recommend keeping it on for better image quality. - true (default, recommended): the prompt is rewritten into a detailed English description- false: the prompt is used as-is Default:true。 Example:true。 |
input.output_format | string | No | Output image format. Optional, default png. JPEG uses quality 95 and is much smaller; 4K PNG files are very large, so use JPEG when you need smaller files. Default:"png"。 Allowed values:png / jpeg。 Example:png。 |
input.image_urls | array<string> | Yes | Required. Reference image URLs (publicly accessible URLs, not file content). - 1–16 images, publicly accessible http(s):// URLs; the order defines <Picture 1>, <Picture 2>, …- Each image ≤ 20 MB and ≤ 64 MP - Supported formats: JPG, PNG, WEBP, HEIC, BMP (transparent backgrounds are filled with white) minItems: 1. maxItems: 16. |
Request Example
curl -X POST "https://modelfold.ai/v1/jobs/createTask" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-h3/image-edit",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.",
"image_urls": [
"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png"
],
"aspect_ratio": "auto",
"resolution": "2K",
"output_format": "png"
}
}'import os
import requests
resp = requests.post(
"https://modelfold.ai/v1/jobs/createTask",
headers={
"Authorization": "Bearer " + os.environ["MODELFOLD_API_KEY"],
"Content-Type": "application/json",
},
json={
"model": "minimax-h3/image-edit",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.",
"image_urls": [
"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png",
],
"aspect_ratio": "auto",
"resolution": "2K",
"output_format": "png",
},
},
)
print(resp.json())const resp = await fetch("https://modelfold.ai/v1/jobs/createTask", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.MODELFOLD_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "minimax-h3/image-edit",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.",
"image_urls": [
"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png"
],
"aspect_ratio": "auto",
"resolution": "2K",
"output_format": "png"
}
}),
});
console.log(await resp.json());package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{"model":"minimax-h3/image-edit","callBackUrl":"https://your-domain.com/api/callback","input":{"prompt":"Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.","image_urls":["https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png"],"aspect_ratio":"auto","resolution":"2K","output_format":"png"}}`)
req, _ := http.NewRequest("POST", "https://modelfold.ai/v1/jobs/createTask", body)
req.Header.Set("Authorization", "Bearer " + os.Getenv("MODELFOLD_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = "{\"model\":\"minimax-h3/image-edit\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"prompt\":\"Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.\",\"image_urls\":[\"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png\"],\"aspect_ratio\":\"auto\",\"resolution\":\"2K\",\"output_format\":\"png\"}}";
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://modelfold.ai/v1/jobs/createTask"))
.header("Authorization", "Bearer " + System.getenv("MODELFOLD_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> resp = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
}
}<?php
$ch = curl_init('https://modelfold.ai/v1/jobs/createTask');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv("MODELFOLD_API_KEY"),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{"model":"minimax-h3/image-edit","callBackUrl":"https://your-domain.com/api/callback","input":{"prompt":"Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.","image_urls":["https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png"],"aspect_ratio":"auto","resolution":"2K","output_format":"png"}}',
]);
echo curl_exec($ch);
curl_close($ch);using System;
using System.Net.Http;
using System.Text;
var client = new HttpClient();
var req = new HttpRequestMessage(new HttpMethod("POST"), "https://modelfold.ai/v1/jobs/createTask");
req.Headers.TryAddWithoutValidation("Authorization", "Bearer " + Environment.GetEnvironmentVariable("MODELFOLD_API_KEY"));
req.Content = new StringContent("{\"model\":\"minimax-h3/image-edit\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"prompt\":\"Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.\",\"image_urls\":[\"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png\"],\"aspect_ratio\":\"auto\",\"resolution\":\"2K\",\"output_format\":\"png\"}}", Encoding.UTF8, "application/json");
var resp = await client.SendAsync(req);
Console.WriteLine(await resp.Content.ReadAsStringAsync());{
"model": "minimax-h3/image-edit",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.",
"image_urls": [
"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png"
],
"aspect_ratio": "auto",
"resolution": "2K",
"output_format": "png"
}
}Response
200 — Request successful.
500 — Server error.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | See the response field; handle the returned status before retrying. |
msg | string | 是 | Response message, error description when failed |
data | object | 是 | — |
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}Callback
onImageGenerated
Callback URL: {$request.body#/callBackUrl} (the callBackUrl in the request body).
Sent when the task succeeds or fails.
Callback body parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | 200 indicates success; any other value indicates failure (e.g., 501). Allowed values:200 / 501。 Example:200。 |
msg | string | 否 | Status message Example:Playground task completed successfully.。 |
data | object | 否 | — |
data.completeTime | integer | 否 | Task completion time, represented as a Unix timestamp in milliseconds Example:1786417450000。 |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. Example:48。 |
data.createTime | integer | 否 | Task creation time, represented as a Unix timestamp in milliseconds Example:1786417400000。 |
data.model | string | 否 | Image-to-image model used for the task Example:minimax-h3/image-edit。 |
data.param | string | 否 | Parameters submitted when creating the task, in JSON string format Example:{"input": "{\"prompt\": \"Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.\", \"image_urls\": [\"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png\"], \"aspect_ratio\": \"auto\", \"resolution\": \"2K\", \"output_format\": \"png\"}", "callBackUrl": "https://your-domain.com/api/callback", "model": "minimax-h3/image-edit"}。 |
data.resultJson | string | 否 | Image generation result in JSON string format. resultUrls contains the list of generated image URLs. Present only when state is success. Example:{"resultUrls": ["https://tempfile.aiquickdraw.com/js/y1/9ef89580655a9e961ad0adb2.png"]}。 |
data.state | string | 否 | Task status Allowed values:success / fail。 Example:success。 |
data.taskId | string | 否 | Task ID Example:e456034b56036f9e976eeecb0fbb49b4。 |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. Example:1786417450000。 |
data.failCode | string | 否 | Failure code, a numeric string such as "400" or "500". Present only when state is fail. Example:500。 |
data.failMsg | string | 否 | Failure reason. Present only when state is fail. Example:<error detail>。 |
Success
{
"code": 200,
"msg": "Playground task completed successfully.",
"data": {
"taskId": "e456034b56036f9e976eeecb0fbb49b4",
"model": "minimax-h3/image-edit",
"state": "success",
"param": "{\"input\": \"{\\\"prompt\\\": \\\"Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.\\\", \\\"image_urls\\\": [\\\"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png\\\"], \\\"aspect_ratio\\\": \\\"auto\\\", \\\"resolution\\\": \\\"2K\\\", \\\"output_format\\\": \\\"png\\\"}\", \"callBackUrl\": \"https://your-domain.com/api/callback\", \"model\": \"minimax-h3/image-edit\"}",
"resultJson": "{\"resultUrls\": [\"https://tempfile.aiquickdraw.com/js/y1/9ef89580655a9e961ad0adb2.png\"]}",
"completeTime": 1786417450000,
"createTime": 1786417400000,
"costTime": 48,
"updateTime": 1786417450000
}
}Failure
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "e456034b56036f9e976eeecb0fbb49b4",
"model": "minimax-h3/image-edit",
"state": "fail",
"param": "{\"input\": \"{\\\"prompt\\\": \\\"Place the skincare products from <Picture 1> on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.\\\", \\\"image_urls\\\": [\\\"https://static.aiquickdraw.com/tools/example/1794319554733_LhkHjUSS.png\\\"], \\\"aspect_ratio\\\": \\\"auto\\\", \\\"resolution\\\": \\\"2K\\\", \\\"output_format\\\": \\\"png\\\"}\", \"callBackUrl\": \"https://your-domain.com/api/callback\", \"model\": \"minimax-h3/image-edit\"}",
"failCode": "500",
"failMsg": "<error detail>",
"completeTime": 1786417450000,
"createTime": 1786417400000,
"costTime": 48,
"updateTime": 1786417450000
}
}