MAI-Image-2.7 Flash API 接入微软 AI MAI-Image-2.7 的优化版,成本更低。使用一个 APIMart API Key 即可调用,无需在 Azure 或 Foundry 部署。参数与标准版相同:支持文生图、单图编辑和最多 5 张参考图合成,每次请求生成一张最大 2048×2048 的 PNG,按实际 Token 计费,输出费率约为标准版的三分之一。
服务亮点
运行按钮仅预估图片输出 Token 费用,文字和参考图输入另计;图生图尺寸未知时显示 —。

生成图片链接在完成后 72 小时内有效,请及时保存。
透明定价,无隐藏费用。按量付费,用多少付多少。
| 型号 | 规格 | 黄金价当前价格 | 铂金价 | 钻石价 | 官方价 | 为你节省 |
|---|---|---|---|---|---|---|
mai-image-2.7-flash价格为预估价格,实际价格按 token 计费。 | 1K · 1024×1024 | 0.0819Credits(~$0.0082)/张 | 0.0778Credits(~$0.0078)/张 | 0.0737Credits(~$0.0074)/张 | 0.1024Credits(~$0.0102)/张 | 20% |
| 2K · 2048×2048 | 0.3277Credits(~$0.0328)/张 | 0.3113Credits(~$0.0311)/张 | 0.2949Credits(~$0.0295)/张 | 0.4096Credits(~$0.041)/张 | 20% |
* 实际费用以最终输出为准。
* 仅预估图片输出费用:1K 按 1024×1024、2K 按 2048×2048 计算。文字与参考图输入另计,最终按实际 Token 结算。
与 MAI-Image-2.7 能力相同,单张成本更低
更快、更省的图像模型最适合的场景
注册账号、充值余额,然后生成第一张图片
注册后即可使用 MAI-Image-2.7、MAI-Image-2.7 Flash 及平台上的其他模型,一个账号全部搞定。
充值余额即可开始。每次请求按实际 Token 用量计费,余额可用于平台所有模型。
在控制台创建 Key,每次请求 MAI-Image-2.7 Flash API 时以 Bearer Token 方式携带。
在 APIMart 上用一次 POST 请求调用 mai-image-2.7-flash 模型。生成为异步任务:先提交任务,再轮询任务接口获取 MAI-Image-2.7 Flash 图片地址。
把上面创建的 Key 存到环境变量 APIMART_API_KEY,每次请求以 Authorization: Bearer <key> 携带。
向 POST /v1/images/generations 提交 model mai-image-2.7-flash 和提示词。文生图加 size 与 resolution,编辑则传 image_urls。响应在 data[0].task_id 返回任务 ID。
每 3–5 秒轮询一次 GET /v1/tasks/{task_id},状态为 completed 后从 data.result.images[0].url[0] 读取 PNG 地址。结果保留 72 小时,请及时下载。失败任务在 data.error.message 返回原因,并全额退款。
完整参数、尺寸对照表与错误码见 MAI-Image-2.7 API 文档。
curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mai-image-2.7-flash",
"prompt": "白色大理石上的玻璃香水瓶,干净的商品图,柔和侧光",
"size": "16:9",
"resolution": "1K"
}'import os
import time
import requests
API_BASE = "https://api.apimart.ai"
headers = {"Authorization": f"Bearer {os.environ['APIMART_API_KEY']}"}
# 1. Submit the generation task
payload = {
"model": "mai-image-2.7-flash",
"prompt": "白色大理石上的玻璃香水瓶,干净的商品图,柔和侧光",
"size": "16:9",
"resolution": "1K"
}
resp = requests.post(f"{API_BASE}/v1/images/generations", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
# 2. Poll the task until it finishes
for _ in range(60):
task_resp = requests.get(f"{API_BASE}/v1/tasks/{task_id}", headers=headers, timeout=30)
task_resp.raise_for_status()
task = task_resp.json()["data"]
if task["status"] == "completed":
print(task["result"]["images"][0]["url"][0])
break
if task["status"] == "failed":
raise RuntimeError(task.get("error", {}).get("message", "generation failed"))
time.sleep(3)
else:
raise TimeoutError(f"task {task_id} did not finish in time; continue GET polling with this task ID")curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mai-image-2.7-flash",
"prompt": "把自行车改成蓝色,并在旁边加一只小狗",
"image_urls": [
"https://example.com/input.png"
]
}'TASK_ID="task_xxx" # replace with the task_id returned by the POST request
curl "https://api.apimart.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIMART_API_KEY"| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | 默认值: mai-image-2.7-flash | 模型 ID:mai-image-2.7-flash;画质更高的版本用 mai-image-2.7。 |
prompt | string | 是 | 默认值: — | 图片描述或编辑指令,支持英文或中文,最长 20,000 字符(中英文均按字符数计算),不能为空。 |
size | string | 否 | 默认值: 1:1 | 1:4 至 4:1 范围内的任意整数宽高比(如 16:9),或像素尺寸(如 2048x1152)。不支持 auto。仅用于文生图。 |
resolution | string | 否 | 默认值: 1K | 1K 或 2K,与宽高比形式的 size 配合使用。2K 下 1:1 为 2048×2048。不支持 4K,传入会返回 HTTP 400。 |
width / height | integer | 否 | 默认值: — | 精确像素,必须成对提供。每边至少 768,总像素不超过 4,194,304;宽高会向下取整到 32 的倍数。优先于 size 和 resolution。 |
image_urls | array | 否 | 默认值: — | 最多 5 张公网图片地址或 Base64 Data URL。传 1 张为编辑,多张为合成。支持 JPEG、PNG,WebP、GIF 会转为 PNG。输出尺寸由模型决定。 |
background | string | 否 | 默认值: — | 只接受 auto 或 opaque,效果与不传相同。transparent 在 APIMart 暂未开放,传入会返回 HTTP 400。 |
nsfw_check | boolean | 否 | 默认值: false | 是否在提交前做内容审核。true:用 omni-moderation-latest 审核提示词和参考图;false 或不传:不审核。 |
n | integer | 否 | 默认值: 1 | 只支持 1。其他值会返回 HTTP 400;需要多张请分别提交任务。 |
了解型号名称、输入、输出限制、价格与结果获取
MAI-Image-2.7 Flash 是微软 AI(Microsoft AI)MAI-Image-2.7 的优化版,成本更低。支持文生图、单图编辑和最多 5 张参考图的多图合成。在 APIMart 上使用模型 ID mai-image-2.7-flash 调用。该模型也写作 MAI Image 2.7 Flash。
两者能力和参数相同。mai-image-2.7-flash 速度更快、成本更低,画质略低;mai-image-2.7 画质更高,适合最终成品。只需修改 model 字段即可切换。
微软于 2026 年 11 月 17 日发布 MAI-Image-2.7 和 MAI-Image-2.7 Flash,并在 Microsoft Foundry 中公开预览。更早的 2026 年 10 月 27 日,微软曾推出仅支持编辑的 MAI-Image-2.7 预览版。
MAI-Image-2.7 Flash 折扣前的价格为:文字输入每百万 Token $1.75,参考图输入每百万 Token $2.50,图片输出每百万 Token $10;当前费率见本页价格表。输出 Token 为宽×高÷1024,因此 1024×1024 约 $0.010,2048×2048 约 $0.041。开通会员可省 20%(黄金)、23%(铂金)或 34%(钻石),失败任务全额退款。
图片输出更便宜:MAI-Image-2.7 Flash 标价每百万输出 Token $10,MAI-Image-2.6 Flash 为 $19。2K 等更大的图片会使用更多 Token,请按实际生成的像素数对比。
model 和 prompt 为必填。可选参数有 size、resolution、width 和 height、image_urls(最多 5 张参考图)、background(只能为 auto 或 opaque)、nsfw_check(内容审核,默认关闭)以及 n(必须为 1)。quality、style、output_format、response_format 和 mask_url 会被忽略。
可以。在 image_urls 中放 1 个图片地址即编辑该图,最多放 5 个即合成。可使用公网 HTTP(S) 地址或 Base64 Data URL;支持 JPEG 和 PNG,WebP 和 GIF 会转换为 PNG。编辑时输出尺寸由模型决定。
使用 1K 或 2K,搭配 1:4 至 4:1 之间的整数宽高比;或使用精确宽高,每边至少 768 像素,总像素不超过 4,194,304。最大正方形为 2048×2048。不支持 auto 尺寸和 4K。
APIMart 暂未开放。微软为 MAI-Image-2.7 提供透明输出,但本平台的 background 目前只接受 auto 或 opaque,传入 transparent 会返回 HTTP 400。
不是。APIMart 不提供 MAI-Image-2.7 Flash 免费额度,每次请求从余额按量扣费。微软以托管服务形式提供该模型,没有公开可下载的权重,因此无法自行部署。
登录 APIMart 并充值后,在 API Keys 页面创建 Key。同一个 Key 可调用 mai-image-2.7-flash、mai-image-2.7 及平台上的所有模型。
向 POST /v1/images/generations 提交后,每 3–5 秒通过 GET /v1/tasks/{task_id} 查询一次,并读取 data.result.images[0].url[0]。结果保留 72 小时,请及时下载。暂停查询不代表生成失败,继续查询原任务即可。
探索同类型的其他模型。

MiniMax H3 Image
Built for image quality and prompt adherence. It handles text-to-image, reference-based generation and image editing. MiniMax says it can generate a 4K (4096 × 4096) image in under 10 seconds and work with up to 16 reference images. In Chinese launch coverage, MiniMax puts its speed at about 1.5 to 2 times that of mainstream tools.

MiniMax H3 Image Highspeed
Built for speed. The same coverage puts it at about 3 to 4 times faster than mainstream tools, which suits batch jobs or anything that needs fast turnaround.

Seedream 5.5
Seedream 5.5 brings your imagination to life through expressive visuals. From dreamy illustrations to cinematic scenes and product concepts, explore color, texture, and light to shape images that tell your story.

GPT Image 2.6 Sunburst
GPT Image 2.6 Sunburst brings a fresh burst of creativity to your ideas. From vibrant illustrations to atmospheric scenes and striking product concepts, explore rich colors, expressive lighting, and thoughtful compositions that make your vision shine.