MAI-Image 2.5

This documentation is valid for the following list of our models:

  • microsoft/mai-image-2.5

Model Overview

MAI-Image 2.5 — image generation model from Microsoft. Produces photorealistic and artistic images from text prompts with support for multiple aspect ratios.

Setup your API Key

If you don't have an API key for the AI/ML API yet, feel free to use our Quickstart guide.

API Schema

post
Body
modelstring · enumRequiredPossible values:
promptstring · min: 1 · max: 4000Required

The text prompt describing the content, style, or composition of the image to be generated.

Example: A photorealistic red sports car on a winding coastal road at sunset, cinematic lighting.
aspect_ratiostring · enumOptional

The aspect ratio of the generated image.

Default: 1:1Example: 16:9Possible values:
max_tokensinteger · min: 1Optional

The maximum number of tokens that can be generated. This value can be used to control costs for text generated via API.

Example: 4096
temperaturenumber · max: 2Optional

What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

Default: 1Example: 1
max_completion_tokensinteger · min: 1Optional

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

Example: 4096
Responses
200Success
application/json
post
/v1/images/generations
200Success

Quick Example

Let's generate an image using a simple text prompt.

Response

We obtained the following image by running this code example:

"A futuristic city at night with neon lights reflecting on wet streets"

Last updated

Was this helpful?