MAI-Image-2.6 API 接入微软 AI 最新的图像模型。使用一个 APIMart API Key 即可调用,无需在 Azure 或 Foundry 部署。支持文生图、单图编辑和最多 5 张参考图合成,每次生成一张 PNG,按实际文字输入、参考图输入与图片输出 Token 结算。
服务亮点
运行按钮仅预估图片输出 Token 费用,文字和参考图输入另计;auto 或图生图尺寸未知时显示 —。

生成图片链接在完成后 72 小时内有效,请及时保存。
透明定价,无隐藏费用。按量付费,用多少付多少。
| 型号 | 规格 | 黄金价当前价格 | 铂金价 | 钻石价 | 官方价 | 为你节省 |
|---|---|---|---|---|---|---|
mai-image-2.6价格为预估价格,实际价格按 token 计费。 | 1K · 1024×1024 | 0.3113Credits(~$0.0311)/张 | 0.2957Credits(~$0.0296)/张 | 0.2802Credits(~$0.028)/张 | 0.3891Credits(~$0.0389)/张 | 20% |
| 2K · 1536×1536 | 0.7004Credits(~$0.07)/张 | 0.6654Credits(~$0.0665)/张 | 0.6304Credits(~$0.063)/张 | 0.8755Credits(~$0.0876)/张 | 20% |
* 实际费用以最终输出为准。
* 仅预估图片输出费用:1K 按 1024×1024、2K 按 1536×1536 计算。文字与参考图输入另计,最终按实际 Token 结算。
微软这款模型擅长什么,以及 API 开放了哪些参数
适合营销、商品与视觉内容团队的实用工作流
注册账号、充值余额,然后生成第一张图片
注册后即可使用 MAI-Image-2.6、MAI-Image-2.6 Flash 及平台上的其他模型,一个账号全部搞定。
充值余额即可开始。每次请求按实际 Token 用量结算,余额可用于平台所有模型。
在控制台创建 Key,每次请求 MAI-Image-2.6 API 时以 Bearer Token 方式携带。
在 APIMart 上用一次 POST 请求调用 mai-image-2.6 模型。生成为异步任务:先提交任务,再轮询任务接口获取 MAI-Image-2.6 图片地址。
把上面创建的 Key 存到环境变量 APIMART_API_KEY,每次请求以 Authorization: Bearer <key> 携带。
向 POST /v1/images/generations 提交 model mai-image-2.6 和提示词。文生图加 size 与 resolution,编辑则传 image_urls。响应在 data[0].task_id 返回任务 ID。
每 3–5 秒轮询一次 GET /v1/tasks/{task_id},状态为 completed 后从 data.result.images[0].url[0] 读取 PNG 地址,并在 expires_at 之前下载(结果保留 72 小时)。失败任务在 data.error.message 返回原因,并全额退款。
完整参数、尺寸对照表与错误码见 MAI-Image-2.6 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.6",
"prompt": "黄昏时分的大学校园海报,标题写着“开放日 2026”,写实摄影风格,电影感光线",
"size": "16:9",
"resolution": "2K"
}'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.6",
"prompt": "黄昏时分的大学校园海报,标题写着“开放日 2026”,写实摄影风格,电影感光线",
"size": "16:9",
"resolution": "2K"
}
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(200):
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.6",
"prompt": "把自行车改成蓝色,并在旁边加一只小狗",
"image_urls": [
"https://example.com/bicycle.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.6 | 模型 ID:mai-image-2.6;更快、更省的版本用 mai-image-2.6-flash。 |
prompt | string | 是 | 默认值: — | 图片描述或编辑指令,支持中文和英文,最长约 32,000 tokens。 |
size | string | 否 | 默认值: 1:1 | 1:4 至 4:1 范围内的任意整数宽高比(如 16:9)、像素尺寸(如 1536x1024)或 auto。仅用于文生图。 |
resolution | string | 否 | 默认值: 1K | 1K 或 2K,与宽高比形式的 size 配合使用。不支持 4K,传入会返回 HTTP 400。 |
width / height | integer | 否 | 默认值: — | 精确像素,必须成对提供。每边至少 768,总像素不超过 2,359,296;宽高会向下取整到 32 的倍数。优先于 size 和 resolution。 |
image_urls | array | 否 | 默认值: — | 最多 5 张公网图片地址或 Base64 Data URL。传 1 张为单图编辑,多张为合成。支持 JPEG、PNG,WebP、GIF 会转为 PNG。输出尺寸由模型决定。 |
auto_aspect_ratio | boolean | 否 | 默认值: false | 设为 true 时由模型根据提示词选择宽高比,等同于 size: auto。 |
web_grounding | boolean | 否 | 默认值: false | 设为 true 时在生成前检索实时信息,适合真实人物、地点或事件。 |
n | integer | 否 | 默认值: 1 | 只支持 1。大于 1 会返回 HTTP 400;需要多张请分别提交任务。 |
了解型号名称、输入、尺寸限制、价格与结果获取
MAI-Image-2.6 是微软 AI(Microsoft AI)的图像生成与编辑模型,是同系列中画质更高的版本,另有 MAI-Image-2.6 Flash。支持文生图、单图编辑和最多 5 张参考图的多图合成。在 APIMart 上使用模型 ID mai-image-2.6 调用。
微软于 2026 年 8 月 10 日发布 MAI-Image-2.6,之后通过 Microsoft Foundry 公开预览提供 API 访问,该消息于 2026 年 9 月 4 日公布。
是。Microsoft Foundry 将它列为 MAI-Image-2.6 (Preview),因为该模型在那里处于公开预览阶段;Preview 是发布状态,不是另一个模型。它也常写作 MAI Image 2.6。在 APIMart 上请使用模型 ID mai-image-2.6。
两者能力和参数相同。mai-image-2.6 画质更高,适合最终成品;mai-image-2.6-flash 速度更快、成本更低,画质略低。只需修改 model 字段即可切换。
model 和 prompt 为必填。可选参数有 size、resolution、width 和 height、image_urls(最多 5 张参考图)、auto_aspect_ratio、web_grounding 以及 n(只能为 1)。quality、style、background、output_format、response_format 和 mask_url 不受支持,传入会被忽略。
image_urls 支持最多 5 个 HTTP(S) 图片地址或 Base64 Data URL。传 1 张为单图编辑,多张为合成。支持 JPEG、PNG,WebP 和 GIF 会转换为 PNG。图片地址必须能够从公网访问。
支持 1K、2K,搭配 1:4 至 4:1 之间的整数宽高比或 auto。精确宽高每边至少 768,总像素不超过 2,359,296;例如 3072×768 有效,2048×2048 超限,不支持 4K。
文生图中,成对 width/height 优先于 size 和 resolution;size 为精确像素时忽略 resolution。精确宽高会向下取为 32 的倍数。有参考图时,尺寸由模型决定,这些参数不生效。
设置为 true 后,生成前先通过 Bing 检索信息,可用于真实人物、地点和事件;默认 false。联网信息不能替代对最终图像的人工核对。
不支持。每次只生成一张 PNG,n 必须为 1。模型不支持蒙版编辑,页面不提供蒙版或输出格式设置。
MAI-Image-2.6 API 的当前费率见本页价格表。按实际文字输入、参考图输入和图片输出 Token 计费。图片输出 Token 为宽×高÷1024;提交时预扣,完成后按实际用量多退少补。页面输出预估不包含文字输入、参考图输入与联网增强费用,失败任务自动全额退款。会员可再省 20%(黄金)、最高 28%(铂金和钻石)。
不是。APIMart 不提供 MAI-Image-2.6 免费额度,每次请求从余额按量扣费。微软以托管服务形式提供该模型,没有公开可下载的权重(例如 Hugging Face 上没有),因此无法自行部署。
登录 APIMart 并充值后,在 API Keys 页面创建 Key。同一个 Key 可调用 mai-image-2.6、mai-image-2.6-flash 及平台上的所有模型。
向 POST /v1/images/generations 提交后,每 3–5 秒通过 GET /v1/tasks/{task_id} 查询一次。完成后请在 expires_at 之前下载保存(结果保留 72 小时)。暂停查询不代表生成失败,可继续查询原任务,无需重复提交。完整参数见 docs.apimart.ai 的 MAI-Image-2.6 文档。
探索同类型的其他模型。

Mai Image 2.6 Flash
MAI-Image-2.6 Flash is the Flash version of Microsoft MAI-Image-2.6 for text-to-image and image editing with up to 5 references, 1K/2K PNG output and optional Bing grounding, billed by actual token usage.

Flux 3 Image
FLUX 3 Image by Black Forest Labs handles text-to-image, single-image editing and generation with up to 10 reference images. It supports multiple aspect ratios and resolutions up to 4K, priced by resolution with no extra charge for references.

Nano banana 2.1
Nano Banana 2.1 is Google's Gemini image model for text-to-image generation and reference-image editing. It outputs 1K, 2K or 4K images in 14 aspect ratios and is available through official and Ext routes.

Seedream 5.0 Flash
Seedream 5.0 Flash is ByteDance's fast, lower-cost text-to-image model. It supports single-image and multi-reference editing with up to 10 references and generates 1K, 1.5K or 2K images, or exact pixel sizes, with strong text rendering.