Skip to main content
POST
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

Supported models

Size constraint ⚠️

Seedream’s upstream enforces a minimum of 3,686,400 pixels. Requests below that are rejected with:
Any aspect ratio works as long as width × height ≥ 3,686,400.

Request

Request fields

Response

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

Gemini-compatible generateContent endpoint.

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