Skip to content

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 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/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.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
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. 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_ratiostringNoAspect 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.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; with aspect_ratio: auto, the rewriter also chooses the ratio
- 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。
modelstringYesThe 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 ​

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/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"
  }
}'
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/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())
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/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());
go
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))
}
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/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
<?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);
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/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());
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"
  }
}

Response ​

200 — Request successful. ​

参数类型必填说明
codeinteger否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。
msgstring否Response message, error description when failed 示例:success。
dataobject是—
  data.taskIdstring否Task ID, can be used with Get Task Details endpoint to query task status
  data.recordIdstring否Record ID, can be used to get the record details
json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "",
    "recordId": ""
  }
}

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:1786417135000。
  data.costTimeinteger否Processing time in seconds. Present on both success and failure callbacks. Example:165。
  data.createTimeinteger否Task creation time, represented as a Unix timestamp in milliseconds Example:1786416968000。
  data.modelstring否Image generation model used for the task Example:minimax-h3/text-to-image。
  data.paramstring否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.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:b0e3febbf194d27a345de523d3321555。
  data.updateTimeinteger否Use completeTime as the completion time; updateTime may equal createTime. Example:1786417135000。
  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": "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

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

ModelFold — one API for all the best AI models.