curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "microsoft/mai-image-2.5-pro",
"prompt": "The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.",
"size": "1024x1024"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "microsoft/mai-image-2.5-pro",
"prompt": "The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.",
"size": "1024x1024"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'microsoft/mai-image-2.5-pro',
prompt: 'The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.',
size: '1024x1024'
})
};
fetch('https://api.tikway.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tikway.ai/v1/images/generations",
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([
'model' => 'microsoft/mai-image-2.5-pro',
'prompt' => 'The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.',
'size' => '1024x1024'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"microsoft/mai-image-2.5-pro\",\n \"prompt\": \"The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.\",\n \"size\": \"1024x1024\"\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.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"microsoft/mai-image-2.5-pro\",\n \"prompt\": \"The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.\",\n \"size\": \"1024x1024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.ai/v1/images/generations")
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 \"model\": \"microsoft/mai-image-2.5-pro\",\n \"prompt\": \"The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.\",\n \"size\": \"1024x1024\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1788923928,
"data": [
{
"index": 0,
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
}
],
"model": "microsoft/mai-image-2.5-pro",
"output_format": "png",
"size": "1024x1024",
"usage": {
"input_tokens": 36,
"input_tokens_details": {
"text_tokens": 36
},
"output_tokens": 1024,
"output_tokens_details": {
"image_tokens": 1024
},
"total_tokens": 1060
}
}Generate pictures
microsoft/mai-image-2.5-pro supports Vincent images. The current gateway exposes model, prompt, size and is compatible with response_format; the model only generates 1 PNG. The dimensions must be at least 768 in both width and height, and the total pixels must not exceed 1,048,576.
curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "microsoft/mai-image-2.5-pro",
"prompt": "The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.",
"size": "1024x1024"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "microsoft/mai-image-2.5-pro",
"prompt": "The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.",
"size": "1024x1024"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'microsoft/mai-image-2.5-pro',
prompt: 'The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.',
size: '1024x1024'
})
};
fetch('https://api.tikway.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tikway.ai/v1/images/generations",
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([
'model' => 'microsoft/mai-image-2.5-pro',
'prompt' => 'The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.',
'size' => '1024x1024'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"microsoft/mai-image-2.5-pro\",\n \"prompt\": \"The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.\",\n \"size\": \"1024x1024\"\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.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"microsoft/mai-image-2.5-pro\",\n \"prompt\": \"The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.\",\n \"size\": \"1024x1024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.ai/v1/images/generations")
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 \"model\": \"microsoft/mai-image-2.5-pro\",\n \"prompt\": \"The scenery of the mountains at sunset, the setting sun reflects the mountains and the sky, the light and shadow are soft, the picture is natural and delicate, and has a cinematic feel.\",\n \"size\": \"1024x1024\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1788923928,
"data": [
{
"index": 0,
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
}
],
"model": "microsoft/mai-image-2.5-pro",
"output_format": "png",
"size": "1024x1024",
"usage": {
"input_tokens": 36,
"input_tokens_details": {
"text_tokens": 36
},
"output_tokens": 1024,
"output_tokens_details": {
"image_tokens": 1024
},
"total_tokens": 1060
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Use Doubao Seedream 5.0 Pro to generate images from text.
Required. Forward model ID for MAI Image 2.5 Pro.
microsoft/mai-image-2.5-pro Required. Picture prompt words, the native model context limit is 32,000 tokens.
1"A future city floating on the sea of clouds, with movie-level light and shadow and rich architectural details at sunrise"
OFOX compatible sizes WIDTHxHEIGHT. The width and height of MAI Image 2.5 Pro are at least 768, and the total pixels do not exceed 1,048,576.
^[1-9]\d*x[1-9]\d*$OFOX compatible response format. MAI native output is always a single PNG Base64; b64_json is recommended.
b64_json, url Response
Unify transformed OpenAI Images responses.
Unix timestamp of the image creation time, in seconds.
1788480000
Generate a list of results.
The model ID that actually executes the request.
Actual output format.
actual generated size.
The usage information generated this time.
Hide child attributes
Hide child attributes
Enter the number of tokens.
Output the number of tokens.
Total number of tokens.

