AIAPIAIAPI API

MAI Image 2.6 Edit

Model ID microsoft/mai-image-2.6/edit

概览

支持最多 5 张参考图片的指令式图像编辑模型。

Microsoft · image-to-image

接口

POST /v1/images/generations/async

认证

Authorization: Bearer <AIAPIAIAPI_API_KEY>

请求体

参数类型必填可空默认值约束说明
modelstring是否-values: microsoft/mai-image-2.6/edit用于路由请求的模型 ID。
promptstring是否--描述所需图像的文本提示词。
imagesarray是否-min_items: 1; max_count: 5; accepts: URL, Base64 data1 至 5 张 JPEG 或 PNG 参考图片,每张少于 1376256 像素。
sizestring否否`default`values: default, autodefault 保留输入图片比例;auto 根据提示词和参考图片自动选择比例。
enable_web_searchboolean否否`false`-使用联网搜索为图像生成提供实时信息。

model

类型:string · 必填:是 · 可空:否

用于路由请求的模型 ID。

prompt

类型:string · 必填:是 · 可空:否

描述所需图像的文本提示词。

images

类型:array · 必填:是 · 可空:否

1 至 5 张 JPEG 或 PNG 参考图片,每张少于 1376256 像素。

size

类型:string · 必填:否 · 可空:否

default 保留输入图片比例;auto 根据提示词和参考图片自动选择比例。

类型:boolean · 必填:否 · 可空:否

使用联网搜索为图像生成提供实时信息。

请求示例

curl --request POST \
  --url https://aiapiaiapi.com/v1/images/generations/async \
  --header 'Authorization: Bearer $AIAPIAIAPI_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
      "model": "microsoft/mai-image-2.6/edit",
      "prompt": "A cinematic camera movement through a forest",
      "images": ["https://example.com/reference.jpg"]
    }'

JSON

{
  "model": "microsoft/mai-image-2.6/edit",
  "prompt": "A cinematic camera movement through a forest",
  "images": ["https://example.com/reference.jpg"]
}

响应

{
  "code": "success",
  "message": "",
  "data": { "task_id": "image_01K2ABC123" }
}

任务状态

使用创建响应中的 task_id 查询:

GET /v1/images/generations/async/{task_id}

{
  "code": "success",
  "message": "",
  "data": {
    "task_id": "image_01K2ABC123",
    "status": "SUCCESS",
    "progress": "100%",
    "outputs": ["https://cdn.example.com/images/image_01K2ABC123.png"],
    "start_time": 1786960805,
    "finish_time": 1786960900,
    "submit_time": 1786960800,
    "fail_reason": ""
  }
}

错误响应

参数校验错误返回 HTTP 400,并包含稳定的错误代码。

{
  "code": "unsupported_parameter",
  "message": "The parameter is not supported by this model.",
  "data": null
}

文档索引

获取完整文档索引:

https://aiapiaiapi.com/llms.txt

使用该文件发现所有可用的 API 文档。