Skip to main content
POST
标准的 OpenAI 兼容 POST /v1/images/generations endpoint。截至 2026 年 7 月 28 日,它服务 seedream-5-0-260128wan2.7-imagewan2.7-image-progpt-image-2。较早的 seedream-4-5-251128 路由改为通过经由 Chat 的图像生成访问。

路由速览

支持的模型

尺寸限制 ⚠️(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 或更大。
  • 404 openai_error——传入的模型不走该 endpoint(例如 wan2.7-image)。请改用基于 chat 的路由
  • 400 invalid_request——size 字符串格式不正确(例如写成 1024 而不是 1024x1024)。
更多内容参见错误码速率限制

相关

Image Generation via Chat

Wan 2.7 系列使用的 /v1/chat/completions 路由。

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($0.035/次请求)、wan2.7-image($0.030/次请求)、wan2.7-image-pro($0.075/次请求)或 gpt-image-2($0.03/次请求,或 1024×1024 图像 $0.05/张)。

可用选项:
seedream-5-0-260128,
wan2.7-image,
wan2.7-image-pro,
gpt-image-2
prompt
string
必填

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

n
integer
默认值:1

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

必填范围: x >= 1
size
string

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

示例:

"2048x2048"

响应

图像生成成功。

model
string
示例:

"seedream-5-0-260128"

created
integer
示例:

1776495432

data
object[]

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

usage
object