/images/generations 接口,支持文生图,单次最多 10 张。生成较慢,建议客户端超时设为 600 秒以上,且不要自动重试(重试会重复计费)。size 填 auto 或「宽x高」,默认会自动优化提示词,返回结果里的 revised_prompt 是实际使用的提示词。官方文档:https://platform.minimax.io/docs/api-reference/image-generation-h3-generations{
"model": "MiniMax-H3-Image",
"prompt": "一只橘猫趴在窗台上晒太阳,温暖的午后光线,胶片质感",
"size": "2720x1536",
"n": 1,
"response_format": "url"
}curl --location --globoff 'https://接口地址/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Image",
"prompt": "一只橘猫趴在窗台上晒太阳,温暖的午后光线,胶片质感",
"size": "2720x1536",
"n": 1,
"response_format": "url"
}'{
"created": 1792308678,
"data": [
{
"url": "https://example.com/h3-image/output-0.jpg",
"size": "2720x1536",
"revised_prompt": "午后的阳光透过木质窗框洒在窗台上,一只橘猫侧卧晒太阳,眼睛半眯,毛发被镀上金边,背景是虚化的室内绿植,胶片颗粒感,柔和暖色调"
}
],
"output_format": "jpeg",
"usage": {
"generated_images": 1,
"total_tokens": 7254,
"input_tokens": 3174,
"output_tokens": 4080,
"input_tokens_details": {
"text_tokens": 3174,
"image_tokens": 0
},
"output_tokens_details": {
"image_tokens": 4080
}
},
"request_id": "021792308678142a2c883cf675b9804d"
}