Submit a Hidream-H Series Image Generation Task
1. Endpoint
/api/maas/gw/v1/images/generations
2. Method
POST
3. Request Parameters
Header
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer API key, for example sk-xxxxxxxx |
| Content-Type | string | Yes | application/json |
Body (by model)
model_idis required and must match the corresponding model.
Image-qyoyq2bi hidream-H4.5-image
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | Fixed value: Image-qyoyq2bi |
| prompt | string | Yes | Positive text prompt. Recommended length: no more than 300 Chinese characters or 600 English words |
| image | string/array | No | Reference image URL. Supports a single image or multiple images (up to 8) |
| size | string | No | Size in width*height or widthxheight format. Default: 2048*2048 |
| optimize_prompt_options | object | No | Prompt optimization settings. See OptimizePromptOptions |
| sequential_image_generation | string | No | Image-series switch. Options: disabled/auto. Default: disabled |
| sequential_image_generation_options | object | No | Image-series settings. See SequentialImageOptions |
| notify_url | string | No | Callback URL. Not yet available |
| request_id | string | No | Custom task ID |
Image-84977rs4 hidream-H4.0-image
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | Fixed value: Image-84977rs4 |
| prompt | string | Yes | Positive text prompt. Recommended length: no more than 300 Chinese characters or 600 English words |
| image | string/array | No | Reference image URL. Supports a single image or multiple images (up to 8) |
| size | string | No | Size in width*height or widthxheight format. Default: 2048*2048 |
| optimize_prompt_options | object | No | Prompt optimization settings. See OptimizePromptOptions |
| sequential_image_generation | string | No | Image-series switch. Options: disabled/auto. Default: disabled |
| sequential_image_generation_options | object | No | Image-series settings. See SequentialImageOptions |
| notify_url | string | No | Callback URL. Not yet available |
| request_id | string | No | Custom task ID |
Object Structure
OptimizePromptOptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| mode | string | No | Prompt optimization mode: standard/fast. Default: standard |
SequentialImageOptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| max_images | int | No | Maximum number of generated images. Range: [1, 15]. Default: 15 |
Response
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | int | Yes | Response code. 0 means success; any non-zero value indicates an error. See message for details |
| message | string | Yes | Response message |
| result | dict | Yes | Returned result |
result
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | str | Yes | Task ID |