Skip to main content
POST
The standard OpenAI-compatible 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

Supported models

Current prices are on aisa.one/models.

Size constraint ⚠️ (Seedream routes)

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 — as the model reports it, for example generated_images, output_tokens and total_tokens. Token-priced models are charged from the token counts; per-request models are charged once per request
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 pixels — size was too small. Use 1920x1920 or larger.
  • 400 model_route_not_supported — the model doesn’t serve this endpoint (e.g., a text model like gpt-4.1-mini). The error body’s supported_routes lists the routes it does serve.
  • 404 model not found — the model ID doesn’t exist on the gateway (e.g., the retired seedream-4-5-251128). Check the model catalog.
  • 400 invalid_request — malformed size string (e.g., 1024 instead of 1024x1024).
See Error Codes and Rate Limits for more.

Model catalog

Current model IDs and the endpoints each one serves.

Gemini generateContent

Gemini-compatible generateContent endpoint.

Media Gen skill

Agent skill that wraps image + video generation.

Request contract

  • Method and path: POST /v1/images/generations
  • Availability: enabled
  • Request URL template: https://api.aisa.one/v1/images/generations
  • X-AISA-Cost-Mode: header; optional
Complete OpenAPI definition Effective request declaration (including authentication and referenced schemas):

Cost and request rules

Price depends on the selected model. Fixed-price models charge once per request, regardless of n; token-priced models charge for actual token usage. Your account price may differ; use a request quote where supported.

Authorizations

Authorization
string
header
required

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

Headers

X-AISA-Cost-Mode
enum<string>

Return a free, read-only cost quote for this caller and payload instead of generating.

Available options:
quote

Body

application/json
model
string
required

An image model from GET /v1/models, for example seedream-5-0-260128, wan2.7-image or gpt-image-2.

Minimum string length: 1
prompt
string
required

Text description of the image to generate.

Minimum string length: 1
image

Reference image(s) for models that start from a picture, as an https or data: URL.

n
integer
default:1

Number of images, for models that support more than one.

Required range: x >= 1
size
string

WIDTHxHEIGHT, for example 2048x2048. Accepted sizes depend on the model.

Example:

"2048x2048"

Response

Generated images.

data
object[]
required
created
integer