curl --request POST \
--url https://api.aisa.one/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-5-0-260128",
"prompt": "A cute red panda, ultra-detailed, cinematic lighting"
}
'{
"model": "seedream-5-0-260128",
"created": 1776495432,
"data": [
{
"url": "https://cdn.aisa.one/images/seedream/20260418-abc.png",
"size": "2048x2048"
}
],
"usage": {
"generated_images": 1,
"output_tokens": 16384,
"total_tokens": 16384
}
}OpenAI-Compatible Image Generations
Generate images with Seedream, Wan, gpt-image-2, and GPT Image 2.5 via the standard POST /v1/images/generations endpoint. OpenAI-compatible request shape; Seedream routes require a minimum image size of 3,686,400 pixels (e.g., 1920×1920).
curl --request POST \
--url https://api.aisa.one/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-5-0-260128",
"prompt": "A cute red panda, ultra-detailed, cinematic lighting"
}
'{
"model": "seedream-5-0-260128",
"created": 1776495432,
"data": [
{
"url": "https://cdn.aisa.one/images/seedream/20260418-abc.png",
"size": "2048x2048"
}
],
"usage": {
"generated_images": 1,
"output_tokens": 16384,
"total_tokens": 16384
}
}POST /v1/images/generations endpoint. As of September 30, 2026 it serves seedream-5-0-260128, wan2.7-image, wan2.7-image-pro, gpt-image-2, gpt-image-2.5-flare, and gpt-image-2.5-sunburst. No image model is served on POST /v1/chat/completions — image generation goes through this endpoint (and POST /v1/images/edits where noted).
Routing at a glance
| Model | Endpoint |
|---|---|
seedream-5-0-260128 | POST /v1/images/generations (this page) |
wan2.7-image / wan2.7-image-pro | POST /v1/images/generations (this page), POST /v1/images/edits |
gpt-image-2 | POST /v1/images/generations (this page), POST /v1/images/edits |
gpt-image-2.5-flare / gpt-image-2.5-sunburst | POST /v1/images/generations (this page), POST /v1/images/edits |
| Gemini-compatible models | POST /v1beta/models/{model}:generateContent |
Supported models
| Model | Billed by | Notes |
|---|---|---|
seedream-5-0-260128 | Per request | Min image size 3,686,400 pixels (e.g., 1920×1920) |
wan2.7-image | Per request | Also accepts POST /v1/images/edits |
wan2.7-image-pro | Per request | Higher-quality Wan route |
gpt-image-2 | Per request or per image; token pricing also applies on some routes | See AI Model Pricing |
gpt-image-2.5-flare | Per 1M tokens: input, output, cache read | GPT Image 2.5 route |
gpt-image-2.5-sunburst | Per 1M tokens: input, output, cache read | GPT Image 2.5 route |
Size constraint ⚠️ (Seedream routes)
Seedream’s upstream enforces a minimum of 3,686,400 pixels. Requests below that are rejected with:400 InvalidParameter: image size must be at least 3686400 pixels
| Size | Pixels | Accepted? |
|---|---|---|
1024x1024 | 1,048,576 | ❌ |
1536x1536 | 2,359,296 | ❌ |
1920x1920 | 3,686,400 | ✅ (exact threshold) |
2048x2048 | 4,194,304 | ✅ |
2304x1600 | 3,686,400 | ✅ |
2560x1920 | 4,915,200 | ✅ |
width × height ≥ 3,686,400.
Request
curl -sS -X POST "https://api.aisa.one/v1/images/generations" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5-0-260128",
"prompt": "A cute red panda, ultra-detailed, cinematic lighting",
"n": 1,
"size": "2048x2048"
}'
from openai import OpenAI
client = OpenAI(base_url="https://api.aisa.one/v1", api_key="sk-aisa-...")
resp = client.images.generate(
model="seedream-5-0-260128",
prompt="A cute red panda, ultra-detailed, cinematic lighting",
n=1,
size="2048x2048",
)
for item in resp.data:
print(item.url)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.aisa.one/v1",
apiKey: process.env.AISA_API_KEY,
});
const resp = await client.images.generate({
model: "seedream-5-0-260128",
prompt: "A cute red panda, ultra-detailed, cinematic lighting",
n: 1,
size: "2048x2048",
});
for (const item of resp.data) {
console.log(item.url);
}
Request fields
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | One of seedream-5-0-260128, wan2.7-image, wan2.7-image-pro, gpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburst |
prompt | string | yes | Text description of the image to generate |
n | integer | no | Number of images. Each is billed separately at the model’s per-request rate |
size | string | no | WIDTHxHEIGHT. Seedream routes must satisfy width × height ≥ 3,686,400; wan2.7-image and gpt-image-2 accept smaller sizes (1024x1024 verified working) |
Response
{
"model": "seedream-5-0-260128",
"created": 1776495432,
"data": [
{
"url": "https://cdn.aisa.one/images/seedream/...",
"size": "2048x2048"
}
],
"usage": {
"generated_images": 1,
"output_tokens": 16384,
"total_tokens": 16384
}
}
modelechoed at the rootdata[].size— actual dimensions of each returned imageusage— includesgenerated_images(drives billing), plusoutput_tokens/total_tokensfor token accounting
data[].url are short-lived. Download and persist the image to your own storage before it expires.Common 4xx causes
400 InvalidParameter — image size must be at least 3686400 pixels—sizewas too small. Use1920x1920or larger.400 model_route_not_supported— the model doesn’t serve this endpoint (e.g., a text model likegpt-4.1-mini). The error body’ssupported_routeslists the routes it does serve.404 model not found— the model ID doesn’t exist on the gateway (e.g., the retiredseedream-4-5-251128). Check the model catalog.400 invalid_request— malformedsizestring (e.g.,1024instead of1024x1024).
Related
Model catalog
Gemini generateContent
Media Gen skill
Request contract
- Method and path: POST /images/generations
- Request URL template: https://api.aisa.one/v1/images/generations
{
"operationId": "createImageGeneration",
"method": "POST",
"path": "/images/generations",
"servers": [
{
"url": "https://api.aisa.one/v1"
}
],
"parameters": [],
"security": [
{
"BearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"model",
"prompt"
],
"properties": {
"model": {
"type": "string",
"enum": [
"seedream-5-0-260128",
"wan2.7-image",
"wan2.7-image-pro",
"gpt-image-2",
"gpt-image-2.5-flare",
"gpt-image-2.5-sunburst"
],
"description": "Image generation model. `seedream-5-0-260128`, `wan2.7-image`, `wan2.7-image-pro`, `gpt-image-2`, `gpt-image-2.5-flare`, or `gpt-image-2.5-sunburst`."
},
"prompt": {
"type": "string",
"description": "Text description of the image to generate."
},
"n": {
"type": "integer",
"minimum": 1,
"default": 1,
"description": "Number of images to generate. Each image is billed separately at the per-image rate."
},
"size": {
"type": "string",
"description": "Image dimensions as `WIDTHxHEIGHT`. Seedream routes require `width × height ≥ 3,686,400` (e.g. `1920x1920`, `2048x2048`); Wan and `gpt-image-2` accept smaller sizes such as `1024x1024`.",
"example": "2048x2048"
}
}
},
"examples": {
"basic": {
"summary": "Single 2K image",
"value": {
"model": "seedream-5-0-260128",
"prompt": "A cute red panda, ultra-detailed, cinematic lighting",
"n": 1,
"size": "2048x2048"
}
},
"minimum_size": {
"summary": "Exactly at minimum allowed size (1920×1920)",
"value": {
"model": "seedream-5-0-260128",
"prompt": "A futuristic cyberpunk city, neon lights, rainy night, 8k",
"n": 1,
"size": "1920x1920"
}
},
"batch": {
"summary": "Four candidates for selection",
"value": {
"model": "seedream-5-0-260128",
"prompt": "Oil painting of a rolling hillside at sunset",
"n": 4,
"size": "2048x2048"
}
}
}
}
}
},
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "AISA API Key"
}
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Image generation model. seedream-5-0-260128, wan2.7-image, wan2.7-image-pro, gpt-image-2, gpt-image-2.5-flare, or gpt-image-2.5-sunburst.
seedream-5-0-260128, wan2.7-image, wan2.7-image-pro, gpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburst Text description of the image to generate.
Number of images to generate. Each image is billed separately at the per-image rate.
x >= 1Image dimensions as WIDTHxHEIGHT. Seedream routes require width × height ≥ 3,686,400 (e.g. 1920x1920, 2048x2048); Wan and gpt-image-2 accept smaller sizes such as 1024x1024.
"2048x2048"