Skip to content

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 ratio1K2K4K
1:11024×10242048×20484096×4096
5:4 / 4:51152×912 / 912×11522304×1824 / 1824×23044576×3648 / 3648×4576
4:3 / 3:41184×880 / 880×11842368×1760 / 1760×23684736×3552 / 3552×4736
3:2 / 2:31248×832 / 832×12482496×1664 / 1664×24965024×3360 / 3360×5024
16:9 / 9:161360×768 / 768×13602720×1536 / 1536×27205472×3072 / 3072×5472
21:91568×6723136×13446272×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.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe 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。
callBackUrlstringNoThe 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。
inputobjectYesInput parameters for the generation task
  input.promptstringYesRequired. Editing instruction, 1–5000 characters; Chinese and English are both supported. Refer to reference images as &lt;Picture 1&gt;, &lt;Picture 2&gt;, … (in image_urls order). minLength: 1. maxLength: 5000. Example:Place the skincare products from &lt;Picture 1&gt; on a sunlit white marble bathroom counter. Keep the product shapes, colors and label text unchanged.。
  input.aspect_ratiostringNoAspect 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.seedintegerNoRandom 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_promptbooleanNoWhether 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_formatstringNoOutput 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_urlsarray&lt;string&gt;YesRequired. Reference image URLs (publicly accessible URLs, not file content).
- 1–16 images, publicly accessible http(s):// URLs; the order defines &lt;Picture 1&gt;, &lt;Picture 2&gt;, …
- 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 ​

bash
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"
  }
}'
python
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())
javascript
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());
go
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))
}
java
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
<?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);
csharp
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());
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"
  }
}

Response ​

200 — Request successful. ​

500 — Server error. ​

参数类型必填说明
codeinteger是See the response field; handle the returned status before retrying.
msgstring是Response message, error description when failed
dataobject是—
json
{
  "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

参数类型必填说明
codeinteger否200 indicates success; any other value indicates failure (e.g., 501). Allowed values:200 / 501。 Example:200。
msgstring否Status message Example:Playground task completed successfully.。
dataobject否—
  data.completeTimeinteger否Task completion time, represented as a Unix timestamp in milliseconds Example:1786417450000。
  data.costTimeinteger否Processing time in seconds. Present on both success and failure callbacks. Example:48。
  data.createTimeinteger否Task creation time, represented as a Unix timestamp in milliseconds Example:1786417400000。
  data.modelstring否Image-to-image model used for the task Example:minimax-h3/image-edit。
  data.paramstring否Parameters submitted when creating the task, in JSON string format Example:{"input": "{\"prompt\": \"Place the skincare products from &lt;Picture 1&gt; 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.resultJsonstring否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.statestring否Task status Allowed values:success / fail。 Example:success。
  data.taskIdstring否Task ID Example:e456034b56036f9e976eeecb0fbb49b4。
  data.updateTimeinteger否Use completeTime as the completion time; updateTime may equal createTime. Example:1786417450000。
  data.failCodestring否Failure code, a numeric string such as "400" or "500". Present only when state is fail. Example:500。
  data.failMsgstring否Failure reason. Present only when state is fail. Example:&lt;error detail&gt;。

Success

json
{
  "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

json
{
  "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
  }
}

ModelFold — one API for all the best AI models.