curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "mai-image-2.7",
"input": {
"prompt": "A university campus poster at dusk with the title \"Open Day 2026\", photorealistic, cinematic light",
"size": "16:9",
"resolution": "2K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1794383400-abcd1234",
"status": "not_started",
"created_time": "2026-11-11T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}Microsoft
MAI Image 2.7
The MAI Image 2.7 API from Microsoft generates one image from a prompt, edits a reference image, or combines up to 5 reference images. It supports 1K and 2K output, custom sizes up to about 4 megapixels, transparent backgrounds, and PNG, JPEG, or WebP output.
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "mai-image-2.7",
"input": {
"prompt": "A university campus poster at dusk with the title \"Open Day 2026\", photorealistic, cinematic light",
"size": "16:9",
"resolution": "2K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1794383400-abcd1234",
"status": "not_started",
"created_time": "2026-11-11T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- After submission, a
task_idwill be returned. If you provided acallback_url, when the task status becomesfinishedorfailed, a POST request will be sent to thecallback_url. - Regardless of whether
callback_urlis provided, you can retrieve the response result through the unified Query Task Status endpoint.
mai-image-2.7 to create posters, product shots, logos, and other images from a prompt, or to edit and combine reference images. For a faster, lower-cost option with the same parameters, use MAI Image 2.7 Flash.
Models
- mai-image-2.7 — Microsoft MAI Image 2.7 for text-to-image, image editing, and multi-image composition
Features
- Text-to-image generation from prompts of up to 32,000 characters.
- Editing a single reference image, or combining up to 5 reference images into one image.
- Seven aspect ratios at
1Kor2K, plus customWIDTHxHEIGHTsizes up to 4,194,304 pixels. - Transparent backgrounds for PNG and WebP output.
- PNG, JPEG, or WebP output.
Input modes
- Text-to-image — Omit
image_urls. The output size comes fromsizeandresolution. - Editing / composition — Pass 1 to 5 URLs in
image_urls. One image is edited; two or more images are combined into one. Withoutsize, the output follows the aspect ratio of the first reference image at about 1 megapixel. Withsize, the output uses that size.
Required parameters
prompt(string): Description of the image or the requested edit, 1–32,000 characters. Must contain non-whitespace text. Put any exact on-image text in quotes.
Optional parameters
image_urls(array of strings): 1 to 5 publicly accessible HTTP(S) reference image URLs in JPEG, PNG, or WebP format. Selects editing / composition mode.size(string):1:1,4:3,3:4,3:2,2:3,16:9,9:16, or a customWIDTHxHEIGHT. Text-to-image defaults to1:1. See Size.resolution(string):1Kor2K. Default is1K. Applies to aspect-ratio sizes.background(string):opaqueortransparent. Default isopaque.transparentrequiresoutput_formatpngorwebp.output_format(string):png,jpeg, orwebp. Default ispng.
Size
- Aspect ratios:
1:1,4:3,3:4,3:2,2:3,16:9,9:16.1Koutputs about 1 megapixel (for example,1:1is 1024×1024).2Koutputs about 4 megapixels (for example,16:9is 2720×1536). - Custom
WIDTHxHEIGHTsizes need both sides divisible by 16, each side at least 768, and total pixels at most 4,194,304 (for example2048x2048or3072x1344). A custom size is used exactly as given;resolutionapplies to aspect-ratio sizes. - In editing / composition mode without
size, the output follows the aspect ratio of the first reference image at about 1 megapixel.
Output
- Each request returns one image in the format set by
output_format(pngby default). - With
backgroundset totransparent, the image has an alpha channel. Use it withoutput_formatpngorwebp.
Examples
Text To Image
{
"model": "mai-image-2.7",
"input": {
"prompt": "A university campus poster at dusk with the title \"Open Day 2026\", photorealistic, cinematic light",
"size": "16:9",
"resolution": "2K"
}
}
Image Edit
{
"model": "mai-image-2.7",
"input": {
"prompt": "Change the bicycle to blue and add a small dog next to it",
"image_urls": [
"https://example.com/bicycle.png"
]
}
}
Custom Size
{
"model": "mai-image-2.7",
"input": {
"prompt": "A wide panoramic banner of a mountain range at sunrise",
"size": "3072x1344"
}
}
Transparent Background
{
"model": "mai-image-2.7",
"input": {
"prompt": "A flat vector logo of a red fox head, clean edges, no background",
"background": "transparent",
"output_format": "webp"
}
}
Notes
- Each request returns one image.
image_urlsmust be an array, even for one image.- Reference images are used at up to about 1 megapixel.
Authorizations
All API endpoints require Bearer Token authentication.
Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a key.
Add it to the request header:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Response
Task submitted successfully
Business status code. 200 means success; any other value means the request failed. Always check this field: some validation errors return HTTP 200 with code: 400 in the body.
200: Success400: Invalid request parameters401: Missing or invalid API key402: Insufficient credits403: Permission denied404: Resource not found408: Request timeout429: Rate limit exceeded500: Internal server error502: Upstream service error503: Service unavailable
See Error Codes for details.
Available options:
200, 400, 401, 402, 403, 404, 408, 429, 500, 502, 503 Example:
200