Skip to main content
POST
标准的 OpenAI 兼容 POST /v1/images/generations endpoint。截至 2026 年 9 月 30 日,它服务 seedream-5-0-260128、wan2.7-image、wan2.7-image-pro、gpt-image-2、gpt-image-2.5-flare 和 gpt-image-2.5-sunburst。POST /v1/chat/completions 上没有可用的图像模型——图像生成统一走本 endpoint(标注处另支持 POST /v1/images/edits)。

路由速览

支持的模型

当前价格见 aisa.one/models。

尺寸限制 ⚠️(Seedream 路由)

Seedream 上游强制要求最少 3,686,400 像素。低于该值的请求会被拒绝:
只要 宽 × 高 ≥ 3,686,400,任意宽高比都可以。

请求

请求字段

响应

AIsa 的响应在原生 OpenAI schema 之上增加了几处扩展:
  • 根层级回显 model
  • data[].size——每张返回图像的实际尺寸
  • usage——包含 generated_images(用于计费),以及用于 token 核算的 output_tokens / total_tokens
data[].url 中的 URL 有效期很短。请在过期前下载并保存到你自己的存储中。

常见 4xx 原因

  • 400 InvalidParameter — image size must be at least 3686400 pixels——size 太小。请使用 1920x1920 或更大。
  • 400 model_route_not_supported——该模型不走本 endpoint(例如文本模型 gpt-4.1-mini)。错误体中的 supported_routes 会列出它支持的路由。
  • 404 model not found——网关上不存在该模型 ID(例如已下线的 seedream-4-5-251128)。请查阅模型目录。
  • 400 invalid_request——size 字符串格式不正确(例如写成 1024 而不是 1024x1024)。
更多内容参见错误码和速率限制。

相关

模型目录

当前模型 ID 及各自支持的 endpoint。

Gemini generateContent

Gemini 兼容的 generateContent endpoint。

Media Gen skill

封装图像与视频生成的 Agent 技能。

授权

Authorization
string
header
必填

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

请求体

application/json
model
enum<string>
必填

图像生成模型。seedream-5-0-260128、wan2.7-image、wan2.7-image-pro、gpt-image-2、gpt-image-2.5-flare 或 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
prompt
string
必填

要生成的图像的文本描述。

n
integer
默认值:1

要生成的图像数量。每张图像均按单张图像费率单独计费。

必填范围: x >= 1
size
string

图像尺寸,格式为 宽x高。Seedream 路由要求 宽 × 高 ≥ 3,686,400(例如 1920x1920、2048x2048);Wan 和 gpt-image-2 可接受更小尺寸,如 1024x1024。

示例:

"2048x2048"

响应

图像生成成功。

model
string
示例:

"seedream-5-0-260128"

created
integer
示例:

1776495432

data
object[]

每张生成的图像对应一个条目。

usage
object