Skip to main content
POST
  1. After submission, a task_id will be returned. If you provided a callback_url, when the task status becomes finished or failed, a POST request will be sent to the callback_url.
  2. Regardless of whether callback_url is provided, you can retrieve the response result through the unified Query Task Status endpoint.
Use mai-image-2.6-flash for quick iteration on posters, product shots, and other images from a prompt, or to edit and combine reference images. It accepts the same parameters as MAI Image 2.6 and is faster and lower-cost.

Models

  • mai-image-2.6-flash — Faster, lower-cost Microsoft MAI Image 2.6 Flash 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 1K or 2K, plus custom WIDTHxHEIGHT sizes.
  • Optional web search that looks up real-time information before generating, for current events and real places, products, or people.

Input modes

  • Text-to-image — Omit image_urls. The output size comes from size and resolution.
  • Editing / composition — Pass 1 to 5 URLs in image_urls. One image is edited; two or more images are combined into one. The output is about 1 megapixel and follows the reference images.

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 custom WIDTHxHEIGHT. Default is 1:1. See Size.
  • resolution (string): 1K or 2K. Default is 1K. Applies only to aspect-ratio sizes.
  • enable_web_search (boolean): Look up real-time web information before generating. Default is false.

Size

Each aspect ratio maps to fixed pixel dimensions at the selected resolution:
  • Custom WIDTHxHEIGHT sizes need both sides divisible by 32, each side at least 768, and total pixels at most 2,359,296 (for example 1536x1536 or 3072x768). A custom size is used exactly as given; resolution applies to aspect-ratio sizes.

Examples

Text To Image

Image Edit

Custom Size

Notes

  • Each request returns one PNG image.
  • image_urls must be an array, even for one image.
  • In editing / composition mode, the output size follows the reference images. If you also send size or resolution, use valid values.
  • Reference images larger than 1 megapixel are downscaled before generation.

Authorizations

Authorization
string
header
required

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:

Body

application/json
model
enum<string>
required

MAI Image 2.6 Flash model identifier.

Available options:
mai-image-2.6-flash
input
object
required

Generate one PNG image. With image_urls, edit or combine the reference images.

callback_url
string<uri>

Optional webhook URL for task completion or failure.

Response

Task submitted successfully

code
enum<integer>
required

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: Success
  • 400: Invalid request parameters
  • 401: Missing or invalid API key
  • 402: Insufficient credits
  • 403: Permission denied
  • 404: Resource not found
  • 408: Request timeout
  • 429: Rate limit exceeded
  • 500: Internal server error
  • 502: Upstream service error
  • 503: Service unavailable

See Error Codes for details.

Available options:
200,
400,
401,
402,
403,
404,
408,
429,
500,
502,
503
Example:

200

data
object
required