Skip to main content
POST

Authorizations

Authorization
string
header
required

##All APIs require Bearer Token authentication##

Get API Key:

Visit API Key Management Page to get your API Key

Add to request header:

Body

application/json
model
enum<string>
default:minimax-h3-image
required

Image generation model name. The official channel offers better stability and control for commercial use

Available options:
minimax-h3-image
Example:

"minimax-h3-image"

prompt
string
required

Prompt describing the image to generate or how to edit the input images

Length limits:

  • Up to 32,000 characters (counted as Unicode code points)
  • When prompt_extend is false, only approximately the first 4096 tokens of the prompt take effect
Maximum string length: 32000
Example:

"A beautiful colorful sunset over the ocean"

image_urls
string<uri>[]

List of reference image URLs for image-to-image generation and image editing

Notes:

  • Number of input images per request: 1~16
  • Maximum size per image: 64MB
  • Width and height of each image: 128 to 8192 px
  • Aspect ratio of each image: longest side / shortest side must not exceed 4:1
  • Supported formats: .jpeg, .jpg, .png, .webp, .heic, .heif
  • Image URLs must be directly accessible by the server or trigger a direct download (these URLs usually end in an image extension such as .png or .jpg)
  • Reference images incur additional image input tokens in image-to-image generation and image editing
Example:
size
string
default:auto

Output image size. Supports aspect ratios and explicit pixel dimensions. Default: auto

① Aspect ratio (recommended): X:Y. Common ratios:

  • 1:1: square
  • 1:2 / 2:1: tall / wide
  • 1:3 / 3:1: extra tall / extra wide (at the 3:1 limit)
  • 2:3 / 3:2: standard portrait / landscape
  • 3:4 / 4:3: traditional portrait / landscape
  • 4:5 / 5:4: common social media formats
  • 9:16 / 16:9: mobile / desktop widescreen
  • 9:21 / 21:9: ultrawide formats

Other X:Y values are also supported: X and Y must be integers from 1 to 300, with an aspect ratio ≤ 3:1

② Explicit pixel dimensions: WxH (or W×H), such as 1024x1024, 2720x1536, 5472x3072

  • Pixel budget: 655,360 ≤ width × height ≤ 20,000,000 (approximately 0.65 MP to 20 MP)
  • Aspect ratio: ≤ 3:1

③ auto: the model chooses the aspect ratio automatically; the output area still follows the resolution tier

Out-of-range sizes:

  • Sizes outside these limits return 400; they are not automatically resized or rounded
Example:

"auto"

resolution
enum<string>
default:2K

Resolution shortcut. Applies when size is auto or an aspect ratio; ignored when explicit pixel dimensions are used

Pixel budget (width and height are calculated from the target total pixel count and the size ratio):

  • 1K: ~1 MP (1024² = 1,048,576 pixels)
  • 2K: ~4 MP (2048² = 4,194,304 pixels)
  • 4K: ~16.8 MP (4096² = 16,777,216 pixels)

Actual landscape / square output sizes (portrait sizes swap the corresponding width and height; for example, 3:4 reverses 4:3):

Notes:

  • 1K and 2K use the same number of image output tokens (approximately 4,096 per image); 4K uses approximately 16,384 per image. The returned usage is authoritative
  • Values are case-insensitive
Available options:
1K,
2K,
4K
Example:

"2K"

output_format
enum<string>
default:jpeg

Output image format. Default: jpeg

  • jpeg: lossy compression, smaller files
  • png: lossless
  • webp: balance of file size and quality

Note:

  • Transparent backgrounds are not supported
Available options:
jpeg,
png,
webp
Example:

"jpeg"

n
integer
default:1

Number of images to generate. Each image is billed separately

Notes:

  • Both text input tokens and image input tokens scale proportionally with n
  • If some images fail (for example, due to content safety checks), the task still completes with the successful images. The actual count is determined by results in the response, and billing follows the returned usage
Required range: 1 <= x <= 10
Example:

1

prompt_extend
boolean
default:true

Prompt enhancement: the model rewrites the prompt with more detail before generation. Default: true

Notes:

  • Can only be set to false for text-to-image generation when size is an aspect ratio or explicit pixel dimensions
  • Setting it to false when size is auto or image_urls is provided returns 400
  • When enabled, it adds approximately 2,300 to 3,800 text input tokens per image; when disabled, only the original prompt is counted
Example:

true

callback_url
string<uri>

HTTPS callback address after task completion

Callback Timing:

  • Triggered when task is completed, failed, or cancelled
  • Sent after billing confirmation is completed

Security Restrictions:

  • Only HTTPS protocol is supported
  • Callback to internal IP addresses is prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
  • URL length must not exceed 2048 characters

Callback Mechanism:

  • Timeout: 10 seconds
  • Maximum 3 retries on failure (retries after 1 second/2 seconds/4 seconds)
  • Callback response body format is consistent with the task query API response format
  • Callback address returning 2xx status code is considered successful, other status codes will trigger retry
Example:

"https://your-domain.com/webhooks/image-task-completed"

Response

Image generation task created successfully

created
integer

Task creation timestamp

Example:

1757156493

id
string

Task ID

Example:

"task-unified-1757156493-imcg5zqt"

model
string

Actual model name used

Example:

"minimax-h3-image"

object
enum<string>

Specific task type

Available options:
image.generation.task
progress
integer

Task progress percentage (0-100)

Required range: 0 <= x <= 100
Example:

0

status
enum<string>

Task status

Available options:
pending,
processing,
completed,
failed
Example:

"pending"

task_info
object

Asynchronous task information

type
enum<string>

Task output type

Available options:
text,
image,
audio,
video
Example:

"image"

usage
object

Usage and billing information