Skip to main content
POST

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json

Microsoft MAI Image text-to-image request. Shared by MAI Image 2.5 and 2.5 Flash. Width and height must be provided together; their product must not exceed 1,048,576 pixels. Output is always PNG.

prompt
string
required

Text description of the image to generate

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

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.