APIMart
MAI Image 2.7 model icon
Image

MAI Image 2.7 API

Plan edits with the Microsoft MAI Image 2.7 model. In the MAI Image API Playground, pair a source image with clear instructions for the scene, lighting, text, and details you want to retain.

Image editingScene & lightingText & details

MAI Image 2.7 API configuration

  • Source image from a file or URL
  • Editing instructions in your prompt
  • Form and JSON configuration
Input

Specify what to change and which details to preserve.

Output

Choose an image and describe the changes.

Prepare focused edits with MAI Image 2.7 API

Start with your image and a precise editing goal. Use the editing workspace to separate requested changes from the composition, materials, and details that should stay the same.

MAI Image 2.7 API example: image editing

Use these examples to organize an image-editing request with a source image and an editing prompt, then query the task to retrieve its result.

  1. 1

    Authenticate the MAI Image 2.7 API request

    Save your APIMart API key in the APIMART_API_KEY environment variable. Send it as Authorization: Bearer <key> when submitting the edit and querying the task.

  2. 2

    Submit an image-editing task

    Send POST /v1/images/generations with model set to mai-image-2.7, an editing prompt, and image_urls containing one HTTP or HTTPS source-image URL. Read the task ID from data[0].task_id in the response.

  3. 3

    Retrieve the edited image

    Send GET /v1/tasks/{task_id} to query the task. When its status is completed, read the image URL from data.result.images[0].url[0]. If the status is failed, read the reason from data.error.message.

    See the APIMart documentation for APIMart authentication and general API usage.

POST /v1/images/generations
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",
    "prompt": "Place the product from this image on a marble kitchen counter in soft morning light, keeping its shape and label unchanged.",
    "image_urls": [
      "https://example.com/source-image.jpg"
    ]
  }'

MAI Image 2.7 API parameters

ParameterTypeRequiredDefaultDescription
modelstringRequiredDefault: mai-image-2.7Model value used in this page’s example: mai-image-2.7.
promptstringRequiredDefault: —Describe the edits to make and the elements of the source image to preserve.
image_urlsarrayRequiredDefault: —An array containing exactly one HTTP or HTTPS URL for the source image to edit.