Microsoft AI: MAI-Image-2.7 API
Microsoft AI: MAI-Image-2.7 generates and edits photorealistic images with consistent compositions, accurate text rendering, and controllable transformations.
Microsoft AI: MAI-Image-2.7 accepts text and image inputs and produces image outputs. It generates images from text prompts using a diffusion-based approach, edits existing images through image-to-image transformation, and supports inpainting, text updates, and motion-blur artifact removal. It can remove, replace, or modify object attributes while preserving composition and layout, maintaining visual consistency across iterative edits.
The model is suited to creative generation and design tasks, including scene restyling, relighting, illustrations, logos, icons, product imagery, brand assets, posters, packaging, signs, and commercial designs. It can also restore and enhance existing assets, remove backgrounds from product images, and move products into new settings while changing lighting or mood. MAI-Image-2.7 is available as a public preview in Microsoft Foundry and through fal, Genspark, OpenRouter, and Vercel. MAI-Image-2.7 Flash supports production workloads and powers Canvas.
Updated:
MODEL ID
mai-image-2.7- Context
- 4.096K
- Max output
- 1.024K
- Input
- text / image
- Output
- image
Highlights
- Consistent iterative editing
- Accurate text rendering
- Photorealistic image output
- Preserves composition and layout
- Detailed object transformations
- Supports inpainting
Providers
Compare API prices across providers. Select a provider to view all charges and conditions.
| Uptime | |
|---|---|
Historical observations are not a live health check. Missing data does not mean an outage.
Benchmarks
- 1215
AA-Image-Editing v2.1
Elo;5,478 votes; ranked1st as of2026-11-16.
- 24
Artificial Analysis scene and style
Elo, higher than the next model.
- 1st
Artificial Analysis live-action film
Ranked1st.
- 1st
Artificial Analysis consumer
Ranked1st.
- 1st
Artificial Analysis frontier editing
Ranked1st.
Scores as published by the model provider.
Quick Start
Submit an image task, poll its status, then save the images. These examples use curl and Python 3 (standard library only).
POST https://openapi.felo.ai/api/v1/images/generations
1Get your API key
Create a key from your Felo API Platform account and set it as an environment variable.
export FELO_API_KEY="YOUR_API_KEY"2Make your first request
Optional values vary by model. This example leaves them unset; confirm supported values in Playground before adding them. Request fields sit alongside model and prompt, without an input wrapper.
curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-o created.json \
-d '{
"prompt": "A studio product photo of a ceramic coffee cup on warm linen, soft morning light",
"model": "mai-image-2.7"
}'3Poll the task
Submission returns task_id. Poll every 3 seconds while queued or running; stop on succeeded, failed or interrupted. This example stops waiting after 30 minutes. Keep created.json to resume querying the same task instead of submitting again.
python3 - <<'PY'
import json, os, time
from pathlib import Path
from urllib.parse import quote
from urllib.request import Request, urlopen
task = json.loads(Path("created.json").read_text())
task_id = task["task_id"]
url = "https://openapi.felo.ai/api/v1/images/generations/" + quote(task_id, safe="")
headers = {"Authorization": "Bearer " + os.environ["FELO_API_KEY"]}
deadline = time.monotonic() + 1800
while task["status"] in ("queued", "running"):
if time.monotonic() >= deadline:
raise TimeoutError(f"Keep task_id={task_id} to resume polling")
time.sleep(3)
with urlopen(Request(url, headers=headers), timeout=60) as response:
task = json.load(response)
if task.get("task_id") != task_id or task.get("kind") != "image":
raise ValueError("Unexpected task response")
print(task["status"])
if task["status"] != "succeeded":
raise RuntimeError(task.get("error") or task["status"])
if not task.get("outputs"):
raise ValueError("Task succeeded without image outputs")
Path("task.json").write_text(json.dumps(task))
print("Saved task.json")
PY4Download the output
After success, save outputs from task.json. Results may be HTTPS URLs, URL objects or b64_json. Download signed URLs promptly; media downloads do not use your API key.
python3 - <<'PY'
import base64, json
from pathlib import Path
from urllib.request import urlopen
task = json.loads(Path("task.json").read_text())
if task.get("status") != "succeeded" or not task.get("outputs"):
raise ValueError("No completed image outputs")
extensions = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp", "image/gif": ".gif", "image/avif": ".avif"}
for index, output in enumerate(task["outputs"], 1):
item = output if isinstance(output, dict) else {}
url = output if isinstance(output, str) else item.get("url") or item.get("unsigned_url")
mime = item.get("media_type") or "image/png"
if url and url.startswith("https://"):
with urlopen(url, timeout=60) as response:
data = response.read()
mime = response.headers.get_content_type()
elif url and url.startswith("data:image/") and ";base64," in url:
header, encoded = url.split(",", 1)
mime = header[5:].split(";", 1)[0]
data = base64.b64decode(encoded, validate=True)
elif item.get("b64_json"):
data = base64.b64decode(item["b64_json"], validate=True)
else:
raise ValueError("Unrecognized image output")
path = Path(f"image-{index}" + extensions.get(mime, ".bin"))
path.write_bytes(data)
print(path)
PYinput_references
For image editing, replace the example URL with your HTTPS image URL or a base64 image data URL. Submit once, then use the same polling and saving steps.
curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-o created.json \
-d '{
"prompt": "Keep the product and framing. Replace the background with a sunlit marble countertop.",
"model": "mai-image-2.7",
"input_references": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/product.png"
}
}
]
}'Supported parameters
- n
- background
- max_tokens
- temperature
- aspect_ratio
- input_references
- max_completion_tokens
Prefer the full reference?
API reference →Frequently asked questions
What is Microsoft AI: MAI-Image-2.7?
Microsoft AI: MAI-Image-2.7 accepts text and image inputs and produces image outputs. It generates images from text prompts using a diffusion-based approach, edits existing images through image-to-image transformation, and supports inpainting, text updates, and motion-blur artifact removal. It can remove, replace, or modify object attributes while preserving composition and layout, maintaining visual consistency across iterative edits. The model is suited to creative generation and design tasks, including scene restyling, relighting, illustrations, logos, icons, product imagery, brand assets, posters, packaging, signs, and commercial designs. It can also restore and enhance existing assets, remove backgrounds from product images, and move products into new settings while changing lighting or mood. MAI-Image-2.7 is available as a public preview in Microsoft Foundry and through fal, Genspark, OpenRouter, and Vercel. MAI-Image-2.7 Flash supports production workloads and powers Canvas.
How is usage billed?
Your bill depends on the provider you use, its prices and your usage. Longer inputs or other conditions may have different prices. Billed based on the actual generation cost. See your bill for the final amount.
What inputs and outputs does MAI-Image-2.7 support?
It supports text input and image input, and produces image output.
What image editing tasks does it handle?
It supports image-to-image transformation, inpainting, text updates, motion-blur artifact removal, and object removal, replacement, or attribute changes while preserving composition and layout.
What is MAI-Image-2.7 best suited for?
It is suited to creative generation and design tasks, including photorealistic images, product images, brand assets, illustrations, logos, icons, and commercial designs.
How does it compare with MAI-Image-2.6?
It improved across all10 evaluated use cases and all7 editing actions compared with MAI-Image-2.6.
Where is MAI-Image-2.7 available?
It is available as a public preview in Microsoft Foundry and through fal, Genspark, OpenRouter, and Vercel.