Overview
MAI-Image-2.6 Image Generationendpoint.create endpoint supported3 localized example text, localized example textimage images: | localized example text | Condition | Description |
|---|---|---|---|
| Text-to-Image | If omitted image | image, can Aspect ratio, Resolution or | |
| image | 1 imagesimage | Reference image+, repainting | |
| image | 2~5 imagesimage | multiple imagesReference image subject, or Scenario |
with astask:create endpoint returntaskId, query endpointPolling.
| MAI-Image Model, Capability and Parameter, only and: | model | localized example text |
|---|---|---|
mai-image-2.6 | height quality, Scenario | |
mai-image-2.6-flash | ,,, Pricing |
localized example textmai-image-2.6 as, Flashmodel localized example textmai-image-2.6-flash.
Base URL: https://mm-internal-cn.leonecloud.com
Authentication
All endpoints require a token in the request header for authentication:
Authorization: Bearer {YOUR_AUTH_TOKEN}Quick Start
cURL Example
Create Task (Text-to-Image)
curl -X POST "https://mm-internal-cn.leonecloud.com/v1/images/generations" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"model": "mai-image-2.6",
"prompt": "when,,",
"size": "16:9",
"resolution": "2K"
}'Create Task (image )
curl -X POST "https://mm-internal-cn.leonecloud.com/v1/images/generations" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"model": "mai-image-2.6",
"prompt": ", and in",
"image": ["https://example.com/bicycle.png"]
}'Query Task Status
curl -X GET "https://mm-internal-cn.leonecloud.com/v1/images/generations/task_abc123" \
-H "Authorization: Bearer your_auth_token_here"Endpoints
1. create MAI-Image-2.6 task
POST /v1/images/generations
Create a MAI-Image-2.6 Image Generationtask.
Content-Type: application/json
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | localized example textmai-image-2.6 (Flash localized example textmai-image-2.6-flash) |
| prompt | string | Yes | imageor, supported in, maximum 30000 characters |
| image | string[] | No | Reference imagelist (URL or base64 data URI),up to 5 images; 1 images as image, multiple images as image, exceeds 5 images return ParameterError |
| size | string | No | Text-to-Imagedimensions, default1:1.supported:Aspect ratio (1:4 localized example text4:1 rangeany,16:9), dimensions (1536x1024, supported1536*1024), auto (ModelPrompt) |
| resolution | string | No | Resolution, Optional1K / 2K, default 1K, size.onlyinsize as Aspect ratio orauto when output dimensions |
| n | integer | No | supported1, greater than 1 return ParameterError; multiple imagestask |
| extra_body.width | integer | No | width, andextra_body.height provide |
| extra_body.height | integer | No | height, andextra_body.width provide |
| extra_body.auto_aspect_ratio | boolean | No | astrue when ModelPromptAspect ratio, etc.size: "auto" |
| extra_body.web_grounding | boolean | No | , defaultfalse.astrue when in first when,, or Image |
| callback_url | string | No | Callback notification URL after the task is complete |
| task_nickname | string | No | Task label, query / when |
Description:
- localized example textimagelocalized example text:If omittedText-to-Image, Image-to-Image, no field.
- Text-to-Imagedimensions:localized example textextra_body.width/extra_body.height> localized example textsize> Aspect ratiolocalized example textsizeandresolutionlocalized example text.
- insizelocalized example text1K/2K, will Resolution, default1:1.
- localized example text:width, height768, exceeds2359296(1536×1536), Aspect ratioin1:4localized example text4:1; width, height will 32 (1000x1000output992x992), dimensions 32.,2048x1152,3072x768long side exceeds 1536 dimensions can use.
- Image-to-Imageoutput dimensions Model:100, Reference image; whensize/resolution/extra_body.width/extra_body.heightlocalized example text.
-sizeFormatno, Aspect ratio1:4localized example text4:1,resolutionlocalized example text1K/2K(4K), when, return ParameterError, will.
-imagesupported URL or base64 data URI (data:image/png;base64,...), Formatsupported JPEG, PNG (WEBP, GIF will as PNG).URL must, task will Failure.
- output as PNG.supported Mask,maskreturn ParameterError;quality,style,background,output_formatetc. Parameter.
- token, see below「Billing」.
Text-to-Imageand Aspect ratio
use Aspect ratio+ resolution when, output dimensions ( width and height as 32; short side 768, Aspect ratio when1K can exceeds 100 ): | Aspect ratio | 1K | 2K |
|---|---|---|---|
| 1:1 | 1024×1024 | 1536×1536 | |
| 4:3 / 3:4 | 1152×864 / 864×1152 | 1760×1312 / 1312×1760 | |
| 3:2 / 2:3 | 1248×832 / 832×1248 | 1856×1248 / 1248×1856 | |
| 16:9 / 9:16 | 1344×768 / 768×1344 | 2048×1152 / 1152×2048 | |
| 2:1 / 1:2 | 1536×768 / 768×1536 | 2144×1056 / 1056×2144 | |
| 21:9 / 9:21 | 1792×768 / 768×1792 | 2336×992 / 992×2336 | |
| 4:1 / 1:4 | 3072×768 / 768×3072 | 3072×768 / 768×3072 |
Request Example
① Text-to-Image (Aspect ratio + Resolution)
{
"model": "mai-image-2.6",
"prompt": "A futuristic city at night, neon lights, cyberpunk",
"size": "16:9",
"resolution": "2K"
}② Text-to-Image (localized example text+ )
{
"model": "mai-image-2.6-flash",
"prompt": "and,",
"extra_body": {
"width": 2048,
"height": 1152,
"web_grounding": true
}
}③ image
{
"model": "mai-image-2.6",
"prompt": ", and in",
"image": ["https://example.com/bicycle.png"]
}④ image
{
"model": "mai-image-2.6-flash",
"prompt": "will images Reference image as, with not",
"image": [
"https://example.com/first.png",
"https://example.com/second.jpg"
]
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | int | Status Code, 0 indicates success |
| msg | string | Message |
| data.taskId | string | Task ID, used to query task status |
| data.status | string | Task Status, fixed to processing |
| data.createdAt | string | Created Time |
Response Example
Success
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20261019171626_abc12345",
"status": "processing",
"createdAt": "2026-10-19 17:16:26"
}
}2. Query Task Status
GET /v1/images/generations/{taskId}
query task execute Status.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| taskId | string | Yes | Task ID |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | int | Status Code, 0 indicates success |
| msg | string | Message |
| data.taskId | string | Task ID |
| data.status | string | Task Status:processing / success / failed |
| data.result | string[] | image URL list (Successreturned when applicable) |
| data.errorCode | string | Error Codes (Failurereturned when applicable) |
| data.errorMsg | string | Error Message (Failurereturned when applicable) |
| data.progress | int | , 0-100 |
| data.pointConsume | string | (decimal characters, taskSuccess and after as ) |
| data.taskNickname | string | Task label (create when return ) |
| data.createdAt | string | Created Time (characters) |
| data.updatedAt | string | Updated Time (characters) |
Response Example
Success
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20261019171626_abc12345",
"status": "success",
"result": [
"https://fc-gw-sh.oss-accelerate.aliyuncs.com/downloads/20261019/output_001.png"
],
"progress": 100,
"createdAt": "2026-10-19 17:16:26",
"updatedAt": "2026-10-19 17:16:50"
}
}Failure
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20261019171626_abc12345",
"status": "failed",
"errorMsg": "Failure:",
"createdAt": "2026-10-19 17:16:26",
"updatedAt": "2026-10-19 17:16:45"
}
}Callback Notification
task complete (Success or Failure) when, if Create Task when providecallback_url, was provided when creating the task, the system sends a POST request to that URL.
Headers
Content-Type: application/json
X-Funcloud-Event: task.completed
X-Funcloud-Signature: {localized example text}Body (taskindata fieldin, and「Query Task Status」endpointlocalized example textdata ):```json
{
"event": "task.completed",
"timestamp": "2026-10-19T17:16:50+08:00",
"signature": "a1b2c3d4e5f6...",
"data": {
"taskId": "task_20261019171626_abc12345",
"status": "success",
"result": ["https://fc-gw-sh.oss-accelerate.aliyuncs.com/downloads/output_001.png"],
"createdAt": "2026-10-19 17:16:26",
"updatedAt": "2026-10-19 17:16:50"
}
}
---
## Billing
token, input, image input, image output:
-**input**:Prompt;
-**imageinput**:Reference image images and, Reference image,, height;
-**imageoutput**:output, Resolution height,, height.
Create Taskwhen, taskSuccess after; taskFailure, ParameterErrorCreate Task,.
Model,`mai-image-2.6-flash` localized example text.localized example text「localized example text」as.
---
## Error Codes
| code | Description |
|------|------|
| 0 | Success |
| 10002 | Parametermissing or malformed (prompt as or, Reference image exceeds 5 images,`n` greater than 1,`mask`, `size` no or Aspect ratiorange,`resolution`,`width` / `height` not or,`extra_body` JSON )|
| 10005 | API Key invalid or missing |
| 30003 | Task not found, taskId|
| 40001 | Insufficient balance, no complete,|
| 60001 | Modelcan use, after|
| 90003 | Internal server error |
---
## Best Practices
### Model- image,, image→ `mai-image-2.6`
-,, Pricing→ `mai-image-2.6-flash`
### -→ If omitted `image`
- with Reference image,,→ 1 images`image`
- image (「A subject+ B localized example text」)→ multiple images`image`, and in prompt Description each image character### dimensions| localized example text| Parameter |
|---|---|
| defaultsquare| If omitteddimensions Parameter:`1:1` + `1K`, output 1024×1024 |
| Resolutionlocalized example text+ Aspect ratio | `size: "16:9"`, `resolution: "2K"` |
| localized example text| `size: "1536x1024"`, or`extra_body.width: 1536`, `extra_body.height: 1024` |
| localized example text| `size: "auto"` or`extra_body.auto_aspect_ratio: true` |
supported 4K, dimensions when use 2K or ( exceeds 1536×1536).
### Polling Strategy
- First 30 seconds:query every 3 seconds
- 30 seconds ~ 2 minutes:query every 5 seconds
- After 2 minutes:query every 10 seconds
localized example text`callback_url`, taskcomplete after, no Polling.
### Processing Time Reference
- Text-to-Image / Image-to-Image:Usually 15 ~ 60 seconds
- Resolutionheight, Reference image, when### Prompt recommended
- use,, can (,,, etc. )
- Image-to-Image when, prompt**localized example text**, image
- multiple imagesReference image when,「number images image」「number images image」refer to each image
- and,, when, can`extra_body.web_grounding` - and not can