Skip to main content
POST

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json

Microsoft MAI Image 2.6 text-to-image request. Shared by MAI Image 2.6 and 2.6 Flash. Width and height must be provided together; their product must not exceed 1,048,576 pixels. Output is always PNG. auto_aspect_ratio and web_grounding are optional; omit them to leave upstream defaults (do not send the fields).

prompt
string
required

Text description of the image to generate. Platform limit is 32,000 UTF-8 bytes, not Unicode characters.

Required string length: 1 - 32000
Example:

"A photorealistic concept art poster of a university at sunset, cinematic lighting"

width
integer
default:1024

Image width in pixels (>=768). Must be provided together with height; width x height must not exceed 1,048,576.

Required range: 768 <= x <= 1365
Example:

1024

height
integer
default:1024

Image height in pixels (>=768). Must be provided together with width; width x height must not exceed 1,048,576.

Required range: 768 <= x <= 1365
Example:

1024

auto_aspect_ratio
boolean

Optional. When true, the model chooses the output aspect ratio from the prompt (and any image inputs). Omit this field to leave the requested width and height unchanged. Do not send it unless the caller explicitly wants model-directed framing.

web_grounding
boolean

Optional. When true, the model may retrieve current public information (Bing) as extra context for real-world entities, places, or events. Omit this field to generate from the prompt only. Do not send it unless the caller explicitly wants web-grounded generation.

Response

Task submitted successfully

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required

Detailed data about the submitted asynchronous task.