Image / MAI Image

MAI-Image-2.6 Image Generation

Overview

MAI-Image-2.6 Image Generationendpoint.create endpoint supported3 localized example text, localized example textimage images:localized example textConditionDescription
Text-to-ImageIf omitted imageimage, can Aspect ratio, Resolution or
image1 imagesimageReference image+, repainting
image2~5 imagesimagemultiple imagesReference image subject, or Scenario

with astask:create endpoint returntaskId, query endpointPolling.

MAI-Image Model, Capability and Parameter, only and:modellocalized example text
mai-image-2.6height 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

ParameterTypeRequiredDescription
modelstringYeslocalized example textmai-image-2.6 (Flash localized example textmai-image-2.6-flash)
promptstringYesimageor, supported in, maximum 30000 characters
imagestring[]NoReference imagelist (URL or base64 data URI),up to 5 images; 1 images as image, multiple images as image, exceeds 5 images return ParameterError
sizestringNoText-to-Imagedimensions, default1:1.supported:Aspect ratio (1:4 localized example text4:1 rangeany,16:9), dimensions (1536x1024, supported1536*1024), auto (ModelPrompt)
resolutionstringNoResolution, Optional1K / 2K, default 1K, size.onlyinsize as Aspect ratio orauto when output dimensions
nintegerNosupported1, greater than 1 return ParameterError; multiple imagestask
extra_body.widthintegerNowidth, andextra_body.height provide
extra_body.heightintegerNoheight, andextra_body.width provide
extra_body.auto_aspect_ratiobooleanNoastrue when ModelPromptAspect ratio, etc.size: "auto"
extra_body.web_groundingbooleanNo, defaultfalse.astrue when in first when,, or Image
callback_urlstringNoCallback notification URL after the task is complete
task_nicknamestringNoTask label, query / when
Description:
- localized example textimage localized 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 textsize andresolution localized example text.
- insize localized example text1K / 2K, will Resolution, default1:1.
- localized example text:width, height768, exceeds2359296 (1536×1536), Aspect ratioin1:4 localized example text4:1; width, height will 32 (1000x1000 output992x992), dimensions 32.,2048x1152, 3072x768 long side exceeds 1536 dimensions can use.
- Image-to-Imageoutput dimensions Model:100, Reference image; whensize / resolution / extra_body.width / extra_body.height localized example text.
- size Formatno, Aspect ratio1:4 localized example text4:1, resolution localized example text1K / 2K (4K), when, return ParameterError, will.
- image supported 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,mask return ParameterError;quality, style, background, output_format etc. 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 ratio1K2K
1:11024×10241536×1536
4:3 / 3:41152×864 / 864×11521760×1312 / 1312×1760
3:2 / 2:31248×832 / 832×12481856×1248 / 1248×1856
16:9 / 9:161344×768 / 768×13442048×1152 / 1152×2048
2:1 / 1:21536×768 / 768×15362144×1056 / 1056×2144
21:9 / 9:211792×768 / 768×17922336×992 / 992×2336
4:1 / 1:43072×768 / 768×30723072×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

ParameterTypeDescription
codeintStatus Code, 0 indicates success
msgstringMessage
data.taskIdstringTask ID, used to query task status
data.statusstringTask Status, fixed to processing
data.createdAtstringCreated 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

ParameterTypeRequiredDescription
taskIdstringYesTask ID

Response Parameters

ParameterTypeDescription
codeintStatus Code, 0 indicates success
msgstringMessage
data.taskIdstringTask ID
data.statusstringTask Status:processing / success / failed
data.resultstring[]image URL list (Successreturned when applicable)
data.errorCodestringError Codes (Failurereturned when applicable)
data.errorMsgstringError Message (Failurereturned when applicable)
data.progressint, 0-100
data.pointConsumestring(decimal characters, taskSuccess and after as )
data.taskNicknamestringTask label (create when return )
data.createdAtstringCreated Time (characters)
data.updatedAtstringUpdated 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
Updated 2026-10-19