Skip to content
Dashboard

MAI-Image-2.6 and MAI-Image-2.6-Flash now available on AI Gateway

Kevin Dawkins, Jerilyn Zheng, Zachary Chen

Microsoft’s MAI-Image-2.6 and MAI-Image-2.6-Flash are now available on AI Gateway. Generate images from text or edit existing images with one AI Gateway API key, without a Microsoft account.

Both models support photorealistic images, text rendering, and targeted edits to products, portraits, and layouts. Use up to five reference images to guide edits or combine subjects, with output sizes up to 1536 × 1536 pixels.

  • MAI-Image-2.6 (microsoft/mai-image-2.6): for detailed edits and final assets where image quality is the priority

  • MAI-Image-2.6-Flash (microsoft/mai-image-2.6-flash): for faster, lower-cost generation when exploring prompts or creating variations

To generate an image, use either model ID with a text prompt:

import { writeFile } from 'node:fs/promises';
import { generateImage } from 'ai';
const { image } = await generateImage({
model: 'microsoft/mai-image-2.6',
prompt: 'A blue ceramic vase with wildflowers on a sunlit wooden table.',
size: '1024x1024',
});
await writeFile('image.png', image.uint8Array);

To edit an image, provide a reference image and describe what to change:

import { writeFile } from 'node:fs/promises';
import { generateImage } from 'ai';
const { image: editedImage } = await generateImage({
model: 'microsoft/mai-image-2.6',
prompt: {
text: 'Change the vase to terracotta and keep the flowers and setting.',
images: [image.uint8Array],
},
});
await writeFile('edited-image.png', editedImage.uint8Array);

Try MAI-Image-2.6 or MAI-Image-2.6-Flash in the playground, or read the image generation guide.