curl --request POST \
--url https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A photorealistic product hero shot of a smartwatch on a reflective surface'
})
};
fetch('https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro"
payload = { "prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro"
payload := strings.NewReader("{\n \"prompt\": \"A photorealistic product hero shot of a smartwatch on a reflective surface\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A photorealistic product hero shot of a smartwatch on a reflective surface\"\n}")
.asString();const url = 'https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A photorealistic product hero shot of a smartwatch on a reflective surface'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A photorealistic product hero shot of a smartwatch on a reflective surface'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A photorealistic product hero shot of a smartwatch on a reflective surface\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = ["prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface"] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface"
}'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-mai-t2i-pro-001",
"model_id": "microsoft/mai-image-2.5-pro",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-mai-t2i-pro-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: width x height exceeds the maximum pixel count 1048576"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}MAI Image 2.5 Pro
[Core Function] MAI Image 2.5 Pro is Microsoft’s highest-fidelity text-to-image generation model in the MAI 2.5 family. [Strengths] It excels at producing exceptionally detailed, high-quality images from a text prompt with the same dimension controls as MAI Image 2.5. [Best For] Highly recommended for: premium marketing visuals, hero assets, and maximum-fidelity generation. [Limitations] Do NOT request dimensions below 768 on any side or a width x height product above 1,048,576 pixels; output is always PNG. [Routing] Use this model when maximum quality is required. For faster or lower-cost generation, route to MAI Image 2.5 or MAI Image 2.5 Flash.
curl --request POST \
--url https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A photorealistic product hero shot of a smartwatch on a reflective surface'
})
};
fetch('https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro"
payload = { "prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro"
payload := strings.NewReader("{\n \"prompt\": \"A photorealistic product hero shot of a smartwatch on a reflective surface\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A photorealistic product hero shot of a smartwatch on a reflective surface\"\n}")
.asString();const url = 'https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A photorealistic product hero shot of a smartwatch on a reflective surface'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A photorealistic product hero shot of a smartwatch on a reflective surface'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A photorealistic product hero shot of a smartwatch on a reflective surface\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = ["prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface"] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.modellix.ai/api/v1/microsoft/mai-image-2.5-pro' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"prompt": "A photorealistic product hero shot of a smartwatch on a reflective surface"
}'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-mai-t2i-pro-001",
"model_id": "microsoft/mai-image-2.5-pro",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-mai-t2i-pro-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: width x height exceeds the maximum pixel count 1048576"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Authorizations
API Key authentication. Format: Bearer YOUR_API_KEY.
Body
Microsoft MAI Image text-to-image request. Shared by MAI Image 2.5, 2.5 Pro, and 2.5 Flash. Width and height must be provided together; their product must not exceed 1,048,576 pixels. Output is always PNG.
Text description of the image to generate
1 - 32000"A photorealistic concept art poster of a university at sunset, cinematic lighting"
Image width in pixels (>=768). Must be provided together with height; width x height must not exceed 1,048,576.
768 <= x <= 13651024
Image height in pixels (>=768). Must be provided together with width; width x height must not exceed 1,048,576.
768 <= x <= 13651024