Skip to main content
POST
This endpoint only returns the enhanced prompt. It does not generate images.
This endpoint runs the same prompt enhancement that is built into Text-to-Image and Image Edit: without images, the prompt is enhanced as text-to-image; with reference images, it is enhanced as an image edit. Use it to preview and revise the enhanced prompt, or to call enhancement as a separate step in your own workflow. Supported model: MiniMax-H3-Image; MiniMax-H3-Image-Highspeed is not supported by this endpoint and returns 400. The server waits up to 600 seconds; set the client timeout to at least 600 seconds.
Billing: The input, output and thinking tokens consumed by the enhancement model are converted at their unit prices into equivalent input text tokens and counted in usage.input_tokens; no output tokens are billed separately. Failed requests (including those that fail the content safety check) are not billed.
Two-step generation: For text-to-image, send revised_prompt as the prompt of a Text-to-Image request with disable_prompt_enhanced: true and the aspect_ratio from the response (or your own size / aspect_ratio); the generation request is then not billed for prompt enhancement again. Image edits always apply prompt enhancement, so passing the result to Image Edit enhances and bills it again.

Authorizations

Authorization
string
header
required

HTTP: Bearer Auth

  • Security Scheme Type: http
  • HTTP Authorization Scheme: Bearer API_key, used to verify account information, can be found in Account Management>API Keys.

Body

application/json
model
enum<string>
required

Model name. Supported value: MiniMax-H3-Image

Available options:
MiniMax-H3-Image
prompt
string
required

Text description to enhance, up to 32000 characters (counted as Unicode characters, excluding leading and trailing whitespace); an empty or whitespace-only prompt returns 400.

Maximum string length: 32000
images
object[]

Reference images, 1 to 16. When provided, the prompt is enhanced as an image edit using the reference images; when omitted, it is enhanced as text-to-image.

Reference image limits (total request body ≤ 64 MiB; Base64-encoded data is about 4/3 of the original file size; if the request body would exceed the limit, use public URLs or mm_file://)

Required array length: 1 - 16 elements
size
string
default:auto

Target output size, default auto. Same forms as the generation endpoints; use one of two forms; see Output Size.

  • WIDTHxHEIGHT: e.g. 2720x1536; image-edit enhancement describes the scene in this width-to-height ratio. Area and aspect ratio limits are the same as the generation endpoints; otherwise 400 is returned. In this form, do not set aspect_ratio or area (not even to auto); otherwise 400 is returned
  • auto or omitted: the aspect ratio is determined by aspect_ratio

Size parameters only affect image-edit enhancement; text-to-image enhancement does not read them.

aspect_ratio
string
default:auto

Target aspect ratio, default auto. Can only be set when size is omitted or auto; setting it while size is WIDTHxHEIGHT returns 400.

  • auto: decided by prompt enhancement; see aspect_ratio in the response
  • X:Y: X and Y are integers from 1 to 300 and the ratio is between 1:3 and 3:1 (bounds inclusive), e.g. 16:9, 3:4. Image-edit enhancement describes the scene in this ratio, and the response does not include aspect_ratio
Example:

"16:9"

area
enum<string>
default:4K

Area level: 1K, 2K or 4K, default 4K. Can only be set when size is omitted or auto; setting it while size is WIDTHxHEIGHT returns 400. It does not affect the enhancement result and lets you reuse the same parameters as the generation request.

Available options:
1K,
2K,
4K

Response

Enhancement succeeded; returns the enhanced prompt.

created
integer

Time the response was generated, as a Unix timestamp in seconds.

revised_prompt
string

The enhanced prompt.

aspect_ratio
string

Aspect ratio chosen by prompt enhancement, in X:Y format and between 1:3 and 3:1. Returned only when the ratio is decided by enhancement (size omitted or auto, and aspect_ratio omitted or auto).

Example:

"3:2"

usage
object

Token usage of this request, used for billing. The cost of prompt enhancement is converted into input text tokens; no output tokens are billed separately.

request_id
string

Request ID (the trace ID). Provide it when reporting an issue.