MiniMax H3 Text-to-Image
Endpoint
POST /jobs/createTask
Full URL: https://modelfold.ai/v1/jobs/createTask
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Generate an image from a text prompt with MiniMax-H3-Image.
Prompt expansion is on by default; we recommend keeping it on for better image quality.
Output size
Tier + ratio — resolution (default 2K) sets the size tier and aspect_ratio sets the shape. auto lets the prompt rewriter choose the ratio based on your content (falls back to 1:1 when expand_prompt is false).
| 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/text-to-image, 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 |
|---|---|---|---|
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. Text prompt, 1–5000 characters; Chinese and English are both supported. minLength: 1. maxLength: 5000. Example:A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books。 |
input.aspect_ratio | string | No | Aspect ratio of the output image. Optional, defaults to auto.- auto: the prompt rewriter chooses a ratio based on the content; when expand_prompt is false, auto uses 1: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; with aspect_ratio: auto, the rewriter also chooses the ratio- 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。 |
model | string | Yes | The model name to use for generation. Required field. - Must be minimax-h3/text-to-image for this endpoint Default:"minimax-h3/text-to-image"。 Allowed values:minimax-h3/text-to-image。 Example:minimax-h3/text-to-image。 |
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/text-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books",
"aspect_ratio": "16:9",
"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/text-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books",
"aspect_ratio": "16:9",
"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/text-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books",
"aspect_ratio": "16:9",
"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/text-to-image","callBackUrl":"https://your-domain.com/api/callback","input":{"prompt":"A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books","aspect_ratio":"16:9","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/text-to-image\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"prompt\":\"A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books\",\"aspect_ratio\":\"16:9\",\"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/text-to-image","callBackUrl":"https://your-domain.com/api/callback","input":{"prompt":"A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books","aspect_ratio":"16:9","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/text-to-image\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"prompt\":\"A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books\",\"aspect_ratio\":\"16:9\",\"resolution\":\"2K\",\"output_format\":\"png\"}}", Encoding.UTF8, "application/json");
var resp = await client.SendAsync(req);
Console.WriteLine(await resp.Content.ReadAsStringAsync());{
"model": "minimax-h3/text-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books",
"aspect_ratio": "16:9",
"resolution": "2K",
"output_format": "png"
}
}Response
200 — Request successful.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient balance; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying). 可选值:200 / 401 / 402 / 404 / 422 / 429 / 455 / 500 / 501 / 505。 示例:200。 |
msg | string | 否 | Response message, error description when failed 示例:success。 |
data | object | 是 | — |
data.taskId | string | 否 | Task ID, can be used with Get Task Details endpoint to query task status |
data.recordId | string | 否 | Record ID, can be used to get the record details |
{
"code": 200,
"msg": "success",
"data": {
"taskId": "",
"recordId": ""
}
}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:1786417135000。 |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. Example:165。 |
data.createTime | integer | 否 | Task creation time, represented as a Unix timestamp in milliseconds Example:1786416968000。 |
data.model | string | 否 | Image generation model used for the task Example:minimax-h3/text-to-image。 |
data.param | string | 否 | Parameters submitted when creating the task, in JSON string format Example:{"input": "{\"prompt\": \"A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books\", \"aspect_ratio\": \"16:9\", \"resolution\": \"2K\", \"output_format\": \"png\"}", "callBackUrl": "https://your-domain.com/api/callback", "model": "minimax-h3/text-to-image"}。 |
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:b0e3febbf194d27a345de523d3321555。 |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. Example:1786417135000。 |
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": "b0e3febbf194d27a345de523d3321555",
"model": "minimax-h3/text-to-image",
"state": "success",
"param": "{\"input\": \"{\\\"prompt\\\": \\\"A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books\\\", \\\"aspect_ratio\\\": \\\"16:9\\\", \\\"resolution\\\": \\\"2K\\\", \\\"output_format\\\": \\\"png\\\"}\", \"callBackUrl\": \"https://your-domain.com/api/callback\", \"model\": \"minimax-h3/text-to-image\"}",
"resultJson": "{\"resultUrls\": [\"https://tempfile.aiquickdraw.com/js/y1/9ef89580655a9e961ad0adb2.png\"]}",
"completeTime": 1786417135000,
"createTime": 1786416968000,
"costTime": 165,
"updateTime": 1786417135000
}
}Failure
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "b0e3febbf194d27a345de523d3321555",
"model": "minimax-h3/text-to-image",
"state": "fail",
"param": "{\"input\": \"{\\\"prompt\\\": \\\"A cozy bookstore cafe on a rainy evening, warm lights glowing through the window, a ginger cat sleeping on a stack of books\\\", \\\"aspect_ratio\\\": \\\"16:9\\\", \\\"resolution\\\": \\\"2K\\\", \\\"output_format\\\": \\\"png\\\"}\", \"callBackUrl\": \"https://your-domain.com/api/callback\", \"model\": \"minimax-h3/text-to-image\"}",
"failCode": "500",
"failMsg": "<error detail>",
"completeTime": 1786417135000,
"createTime": 1786416968000,
"costTime": 165,
"updateTime": 1786417135000
}
}