
Remove the red delivery scooter and the orange traffic cone from the alley and fill the space with the wooden wall and street surface behind them. Keep the woman, her bicycle, the lanterns and the soft light unchanged.
microsoft/mai-image-2.7-flash/editThe MAI Image 2.7 Flash Edit API applies written edits to 1–5 reference images at Flash speed and price: change seasons and light, remove objects, update text or turn a sketch into a product photo, while the rest of the image stays in place. A one-image 1K edit costs about 2.6 credits.
Get API KeyDrag and drop files, paste from clipboard, or provide a URL. Provide 1–5 public HTTP(S) JPEG, PNG or WebP image URLs in the order the prompt refers to them. Each image is scaled to about 1 megapixel and adds up to 1,024 image input tokens.
1/5 files added
Maximum upfront charge: 2.71215 credits · $0.01356
Billed by actual tokens. A 1K square image costs about 2.0 credits; the difference is returned after completion.
REST API
This flow submits one valid MAI Image 2.7 Flash Edit request, captures its task_id, and reads image URLs after the asynchronous task ends.
Create an API key, keep it on the server, and send it as Authorization: Bearer VIDGO_API_KEY.
https://api.vidgo.ai/api/generate/submitSend the current model ID, prompt, and ordered image URLs to the unified submit endpoint. The example keeps only first-call fields.
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "microsoft/mai-image-2.7-flash/edit",
"input": {
"prompt": "Replace the empty fountain with clear water and floating orange blossoms. Keep the tiles, plants and light unchanged.",
"image_urls": [
"https://example.com/courtyard.jpg"
],
"resolution": "1K",
"output_format": "png"
}
}'Read data.task_id and poll only while status is not_started or running. Stop on both finished and failed.
GET https://api.vidgo.ai/api/generate/status/{task_id}Poll every 2–5 seconds and back off on 429/5xx. Or provide top-level callback_url to receive a terminal-state callback.
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "not_started",
"created_time": "2026-09-25T08:00:00"
}
}{
"code": 200,
"data": {
"task_id": "task-example",
"status": "finished",
"created_time": "2026-09-25T08:00:00",
"files": [
{
"file_url": "https://example.com/result.png",
"file_type": "image"
}
]
}
}Expand for the same payload end to end, including business-code, missing-task-ID, failed-state, unexpected-state, and network-error handling.
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "microsoft/mai-image-2.7-flash/edit",
"input": {
"prompt": "Replace the empty fountain with clear water and floating orange blossoms. Keep the tiles, plants and light unchanged.",
"image_urls": [
"https://example.com/courtyard.jpg"
],
"resolution": "1K",
"output_format": "png"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
doneThis table lists only public fields inside input. See Quick Start for top-level model and optional callback_url usage.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| input.prompt | string | Yes | – | Edit instruction, up to 32,000 characters. Say what changes and what stays, and refer to references as image 1, image 2 and so on. |
| input.image_urls | string[] | Yes | – | 1–5 public JPEG, PNG or WebP image URLs. One image is edited; several are combined in the order given. |
| input.size | string | No | – | Follows image 1 at about 1 megapixel when empty. Ratios: 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, or custom WIDTHxHEIGHT with both sides multiples of 16, each side at least 768 and up to 4,194,304 pixels in total, used exactly. |
| input.resolution | string | No | 1K | 1K or 2K for ratio sizes. 1K is about 1 megapixel (1024×1024 at 1:1); 2K is about 4 megapixels (2720×1536 at 16:9). 1K, 2K. |
| input.background | string | No | opaque | opaque or transparent. transparent returns an alpha channel with png or webp. opaque, transparent. |
| input.output_format | string | No | png | png, jpeg or webp. png, jpeg, webp. |
The submit response identifies the task. The status response supplies image files or failure details at a terminal state.
| Field | Type | Description |
|---|---|---|
| code | integer | Business response code; 0 or 200 indicates success. |
| message | string | Optional human-readable response message. |
| data.task_id | string | Unique task ID used for status queries after submission. |
| data.status | string | not_started, running, finished, or failed. |
| data.created_time | string | Task creation timestamp. |
| data.progress | integer | Progress from 0–100 in status responses. |
| data.files[] | array | Generated files in returned order when finished. |
| data.files[].file_url | string | Direct generated-image URL. |
| data.files[].file_type | string | Image results are identified as image. |
| data.files[].watermark_url | string | null | Optional watermarked-file URL when present. |
| data.error_message | string | null | Readable failure reason for failed tasks. |
Only the first two states may be polled again. finished and failed are terminal.
not_startedAccepted and queued; wait before checking again.
runningImage generation is in progress; continue polling.
finishedSuccessful terminal state; validate files and read image URLs.
failedFailure terminal state; read error_message and stop.
| Specification | Value | Details |
|---|---|---|
| Model | microsoft/mai-image-2.7-flash/edit | Edit one reference image with text instructions, or combine 2–5 references. |
| size | 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 16:9 / 9:16 / WIDTHxHEIGHT | When omitted, follows the first reference image's aspect ratio at about 1 megapixel. |
| resolution | 1K / 2K | Applies to ratio sizes: 1K is about 1 megapixel (1024×1024 at 1:1), 2K about 4 megapixels (2720×1536 at 16:9). |
| Output | 1 image per request · png / jpeg / webp | Set background to transparent with png or webp for an alpha channel. |
The MAI Image 2.7 Flash Edit API is the editing endpoint of MAI Image 2.7 Flash, the faster, lower-cost version of the image model Microsoft AI released on November 17, 2026. It takes 1–5 reference images and an instruction, edits one image or combines several, and keeps the parts you name intact. You can call it programmatically or try it from the playground above.
Yes. Name the objects to remove and what should fill their place. The Kyoto alley example removes a scooter and a traffic cone while the cyclist, lanterns and light stay as they were.
1 to 5 public JPEG, PNG or WebP URLs in image_urls, referred to as image 1, image 2 and so on. Each is scaled to about 1 megapixel and adds up to 1,024 image input tokens.
Both take the same fields. The MAI Image 2.7 Flash Edit API costs about a third as much per output token and suits previews and batches; MAI Image 2.7 suits final edits with the most detail.
With size empty, the result follows image 1 at about 1 megapixel. Set a ratio with 1K or 2K, or a custom WIDTHxHEIGHT with multiples of 16, at least 768 per side and up to 4,194,304 pixels.