Skip to main content
POST
/
images
/
generations
curl --request POST \
  --url https://api.aisa.one/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "seedream-4-5-251128",
  "prompt": "A cute red panda, ultra-detailed, cinematic lighting",
  "n": 1,
  "size": "2048x2048"
}
'
{
  "model": "seedream-4-5-251128",
  "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
  }
}
The standard OpenAI-compatible POST /v1/images/generations endpoint. Currently routed to ByteDance Seedream (seedream-4-5-251128). Wan 2.7 models do not use this path — see Image Generation via Chat.

Routing at a glance

ModelEndpoint
seedream-4-5-251128POST /v1/images/generations (this page)
wan2.7-image / wan2.7-image-proPOST /v1/chat/completions
gemini-3-pro-image-previewPOST /v1/models/{model}:generateContent

Supported models

ModelCost per imageNotes
seedream-4-5-251128$0.040Min image size 3,686,400 pixels (e.g., 1920×1920)

Size constraint ⚠️

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
SizePixelsAccepted?
1024x10241,048,576
1536x15362,359,296
1920x19203,686,400✅ (exact threshold)
2048x20484,194,304
2304x16003,686,400
2560x19204,915,200
Any aspect ratio works as long as 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-4-5-251128",
    "prompt": "A cute red panda, ultra-detailed, cinematic lighting",
    "n": 1,
    "size": "2048x2048"
  }'

Request fields

FieldTypeRequiredNotes
modelstringyesseedream-4-5-251128
promptstringyesText description of the image to generate
nintegernoNumber of images. Each is billed separately at $0.040
sizestringyesWIDTHxHEIGHT. Must satisfy width × height ≥ 3,686,400

Response

{
  "model": "seedream-4-5-251128",
  "created": 1776495432,
  "data": [
    {
      "url": "https://cdn.aisa.one/images/seedream/...",
      "size": "2048x2048"
    }
  ],
  "usage": {
    "generated_images": 1,
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}
AIsa’s response adds a few extensions over the vanilla OpenAI schema:
  • model echoed at the root
  • data[].size — actual dimensions of each returned image
  • usage — includes generated_images (drives billing), plus output_tokens / total_tokens for token accounting
URLs in 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 pixelssize was too small. Use 1920x1920 or larger.
  • 404 openai_error — you passed a model that isn’t routed through this endpoint (e.g., wan2.7-image). Use the chat-based route instead.
  • 400 invalid_request — malformed size string (e.g., 1024 instead of 1024x1024).
See Error Codes and Rate Limits for more.

Image Generation via Chat

The /v1/chat/completions route for the Wan 2.7 family.

Gemini generateContent

Image preview through Gemini 3 Pro.

Media Gen skill

Agent skill that wraps image + video generation.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Image generation model. Currently only seedream-4-5-251128 is routed through this endpoint. Wan 2.7 models use /v1/chat/completions.

Available options:
seedream-4-5-251128
prompt
string
required

Text description of the image to generate.

n
integer
default:1

Number of images to generate. Each image is billed separately at the per-image rate.

Required range: x >= 1
size
string

Image dimensions as WIDTHxHEIGHT. Must satisfy width × height ≥ 3,686,400. Common valid values: 1920x1920, 2048x2048, 2304x1600, 2560x1920.

Example:

"2048x2048"

Response

Images generated successfully.

model
string
Example:

"seedream-4-5-251128"

created
integer
Example:

1776495432

data
object[]

One entry per generated image.

usage
object