Skip to main content
POST

Authorizations

Authorization
string
header
required

使用来自 https://omniall.ai/dashboard 的 Authorization: Bearer sk-...

Body

application/json

OpenAI 兼容生图请求体(POST /v1/images/generations),对应网关 dto.ImageRequest。适用于 GPT-Image、DALL·E、Flux、Grok Imagine、Seedream/即梦生图渠道,以及许多路由到该路径的 Gemini 图像模型。

model
string
required

模型 ID,来自模型广场 / GET /v1/models。示例:gpt-image-2.6、gpt-image-2.6-flare、gpt-image-2.6-sunburst、gpt-image-2.6-exact、dall-e-3、flux-3-image-klein、flux-pro-1.1-ultra、grok-imagine-image、doubao-seedream-5-0-pro-260628、gemini-2.5-flash-image。

Example:

"gpt-image-2.6"

prompt
string
required

图像描述文本。尽量写清主体、风格、光影与构图。

Example:

"一间采光柔和的安静工作室"

n
integer
default:1

生成张数。费用通常随 n 增加;部分模型只允许 n=1。

Required range: 1 <= x <= 128
size
string

输出尺寸。可用像素字符串(如 1024x1024、2048x1152、3840x2160、auto),或配合 aspect_ratio + quality/image_size(1K/2K/4K)。GPT-Image 系列常用比例见 GPT-Image 文档中的比例表(3:1~1:3)。自定义尺寸建议:单边 ≤ 3840、宽高为 16 的倍数、长宽比 ≤ 3:1。

Example:

"1024x1024"

quality
string

质量档位。GPT-Image 常用:low / medium / high / auto;部分模型亦用 1K / 2K / 4K(与比例表对应)。

Example:

"high"

aspect_ratio
enum<string>

画幅比例,如 1:1、16:9、9:16、3:2、4:3、21:9、3:1、1:3 等。与 1K/2K/4K 档位组合时的像素尺寸见 GPT-Image 文档比例表。

Available options:
3:1,
21:9,
16:9,
3:2,
4:3,
1:1,
3:4,
2:3,
9:16,
1:3,
4:5,
5:4
Example:

"1:1"

image_size
string

提供方特定的 image_size 字段(透传,不会改写成 resolution)。

resolution
string

提供方特定的 resolution 字段(与 image_size 独立透传)。

response_format
enum<string>

返回 URL 还是 Base64 JSON。支持时默认常为 url。

Available options:
url,
b64_json
style
any

风格提示(如 DALL·E 的 vivid / natural)。

background
any

背景控制(如 GPT-Image 透明/不透明背景)。

moderation
any

审核级别(模型支持时)。

output_format
enum<string>

输出文件格式。GPT-Image 2.6:png、jpeg、webp、gif(动图)、svg(矢量,仅文生图、不带参考图、非流式)。

Available options:
png,
jpeg,
jpg,
webp,
gif,
svg
Example:

"png"

frame_count
integer

GIF 帧数,取值 1~144。

Required range: 1 <= x <= 144
Example:

16

frame_duration_ms
integer

GIF 每帧时长,单位毫秒,取值 20~2000。

Required range: 20 <= x <= 2000
Example:

120

output_compression
any

支持压缩格式时的压缩强度。

partial_images
any

渐进/分片出图选项(模型支持时)。

stream
boolean

若上游支持流式出图(如部分 GPT-Image),可请求流式事件。

watermark
boolean

是否请求水印(提供方支持该开关时)。

image

可选参考图(图生图 / 多图参考)。

  • 推荐:单个 HTTPS URL,或 URL 字符串数组
  • 不建议:Base64 / data:image/...;base64,...(请求体过大,易 413) 本地文件请先上传拿到 URL 再传入。带参考图时更完整的编辑能力请用 /v1/images/edits。
user
any

终端用户标识(不透明),用于滥用监测。

extra_fields
any

预留扩展字段。有文档字段时请优先用顶层标准字段。

Response

生图结果

OpenAI 兼容生图响应。

created
integer

完成时的 Unix 时间戳。

data
object[]

生成的图像列表。