Skip to main content
POST
MAI Image 2.7 Flash

Headers

Authorization
string

Body

application/json
model
enum<string>
required

Model name. Must be mai-image-2-7-flash.

Available options:
mai-image-2-7-flash
prompt
string
required

Text description or editing instructions, up to 20,000 characters. Input billing uses the UTF-8 byte length of the trimmed prompt.

Required string length: 1 - 20000
ratio
enum<string>
default:1:1

Output aspect ratio for text-to-image. auto is not supported. Ignored when width/height or image_list is provided.

Available options:
1:1,
4:3,
3:4,
3:2,
2:3,
16:9,
9:16,
2:1,
1:2,
21:9,
9:21,
4:1,
1:4
image_size
enum<string>
default:1K

Resolution tier for text-to-image (1K or 2K; 4K is not supported). Ignored when width/height or image_list is provided.

Available options:
1K,
2K
width
integer

Optional exact pixel width for text-to-image only. Must be provided together with height, both >= 768 and width * height <= 4,194,304. Rounded down to a multiple of 32 by the model. Overrides ratio and image_size.

Required range: 768 <= x <= 4096
height
integer

Optional exact pixel height for text-to-image only. Must be provided together with width.

Required range: 768 <= x <= 4096
background
enum<string>

Optional background mode (opaque or auto). Transparent background is not supported.

Available options:
opaque,
auto
image_list
object[]

Up to 5 direct public image URLs for single-image editing or multi-image composition. Each image must return HTTP 200 or 206 without redirects (max 50MB). Output dimensions are determined by the model from the reference images.

Maximum array length: 5
custom_callback_url
string<uri>

Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.

Example:

"https://your-server.com/goenhance/callback"

Response

code
integer
required
msg
string
required
data
object
required