Skip to main content
POST

Authentication

string
required
All endpoints use Bearer Token authentication. Get your key from the API Key page.

Model overview

By default, MiniMax H3 Image automatically expands your prompt into a detailed scene description before generating the image. The expanded text is available in revised_prompt in the query result. To generate strictly from your original text, see Disable prompt enhancement.
If resolution is omitted, output defaults to 4K (about 16 megapixels), which costs about 3 times as much as 1K / 2K. If you don’t need 4K, pass "resolution": "2K" explicitly.

Request parameters

string
required
Image generation model name. Must be minimax-h3-image.
string
required
Text description for image generation or editing.The prompt supports Chinese and English. After trimming leading and trailing whitespace, it must be 1 – 32,000 characters long.
string[]
Array of reference images, up to 16. Passing this field automatically switches to editing mode.Each item can be a publicly accessible http(s):// direct link or inline Base64 in data:image/png;base64,... format (the platform converts it to a link before sending it to the model).See Reference image requirements.
string
default:"auto"
Aspect ratio or exact pixel dimensions of the output image.Supported values:
  • auto: the model chooses composition and aspect ratio based on the prompt
  • Aspect ratio: X:Y format, where X and Y are integers from 1 to 300 and the ratio is between 1:3 and 3:1 (inclusive), such as 1:1, 4:3, 16:9, 9:16, 3:1
  • Exact pixels: WIDTHxHEIGHT, such as 2048x1152 (X, ×, and * are also accepted as separators)
See Size rules.
string
default:"4K"
Resolution tier. Combined with the aspect ratio, it determines the actual output pixels.
  • 1K: about 1 megapixel
  • 2K: about 4.2 megapixels
  • 4K (default): about 16 megapixels
Lowercase values are also accepted.
When size uses exact pixels, you cannot pass resolution; otherwise the request returns 400.
integer
default:"1"
Number of images to generate, from 1 to 10.
boolean
default:"true"
Whether to automatically expand the prompt.Setting it to false only works for text-to-image and requires an explicit size. See Disable prompt enhancement.
string
default:"jpeg"
Output file format.
  • jpeg (default; jpg is also accepted)
  • png
  • webp
integer
default:"95"
Compression quality, from 0 to 100. Has no effect on png.
boolean
default:"false"
Whether to add a visible AI-generated watermark to the image. Does not affect the implicit marker in the image metadata.
The following parameters are not supported and are ignored if passed: quality, style, seed, negative_prompt, background, mask_url.Results are always returned as URLs. Passing response_format: "b64_json" returns 400.

Size rules

Tier + aspect ratio

The tier determines the total area, and the aspect ratio determines the shape: The model rounds the actual output pixels based on the ratio and tier; refer to the returned result. For exact dimensions, use the pixel format.

Exact pixels

When using size: "WIDTHxHEIGHT", the following constraints apply:
  • ✅ 1024x1024, 2048x1152, 1536x1536, 4000x5000
  • ❌ 512x512 (area too small), 4000x1000 (ratio exceeds 3:1), 5000x5000 (exceeds 20 megapixels)

Reference image requirements

When using URLs, make sure the links are publicly accessible. If a link cannot be reached, the task fails during generation (status is failed, and the charge is fully refunded).Prompt enhancement is always on in editing mode and cannot be disabled.

Disable prompt enhancement

By default, the model expands the prompt before generating the image. To generate strictly from your original text, pass "prompt_optimizer": false, provided that:
  • It is used only for text-to-image; requests with image_urls return 400
  • An explicit size is specified: size must be an aspect ratio (such as 1:1) or pixels (such as 1024x1024), not auto or omitted
When disabled, the model reads only about the first 4096 tokens of the prompt.

Response

integer
Response status code; 200 when submission succeeds.
array
Submission response data.

Submission response

A successful submission immediately returns an asynchronous task ID:

Query task results

Call the task status endpoint with the task_id from the submission response:
In testing, a single 1K / 2K image takes about 10 – 20 seconds, 4K about 20 seconds, and reference image editing about 20 seconds. Poll every 3 – 5 seconds until the status becomes completed or failed. A single task can run for up to 600 seconds; set your client polling timeout to 10 minutes.

Successful task

Image URLs are in data.result.images[0].url[], with all n images in this single array. Download and store them before expires_at. If the task fails, status is failed, the reason is in error.message, and the charge is automatically refunded in full.

Usage examples

Text to image (default 4K)

Text to image (1K + aspect ratio, 4 images)

Exact pixels + PNG

Reference image editing

Disable prompt enhancement