{
"created": 1710000000,
"data": [
{
"url": "https://example.com/image.png"
}
]
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}Generations
OpenAI 兼容图像生成。
路径: POST https://api.omniall.ai/v1/images/generations
推荐通用生图入口。image 可为单个 URL/Base64 或 字符串数组(多图参考);带参考图时部分渠道会自动改走 /v1/images/edits 或 Chat 桥接。
Gemini 原生亦可使用 generateContent。
{
"created": 1710000000,
"data": [
{
"url": "https://example.com/image.png"
}
]
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}Authorizations
使用来自 https://omniall.ai/dashboard 的 Authorization: Bearer sk-...
Body
OpenAI 兼容生图请求体(POST /v1/images/generations),对应网关 dto.ImageRequest。适用于 GPT-Image、DALL·E、Flux、Grok Imagine、Seedream/即梦生图渠道,以及许多路由到该路径的 Gemini 图像模型。
模型 ID,来自模型广场 / GET /v1/models。示例:gpt-image-1、gpt-image-2、dall-e-3、flux-pro、grok-imagine-image、doubao-seedream-5-0-pro-260628、gemini-2.5-flash-image。
"gpt-image-2"
图像描述文本。尽量写清主体、风格、光影与构图。
"一间采光柔和的安静工作室"
生成张数。费用通常随 n 增加;部分模型只允许 n=1。
1 <= x <= 128输出尺寸。可用像素字符串(如 1024x1024、2048x1152、3840x2160、auto),或配合 aspect_ratio + quality/image_size(1K/2K/4K)。GPT-Image 系列常用比例见 GPT-Image 文档中的比例表(3:1~1:3)。自定义尺寸建议:单边 ≤ 3840、宽高为 16 的倍数、长宽比 ≤ 3:1。
"1024x1024"
质量档位。GPT-Image 常用:low / medium / high / auto;部分模型亦用 1K / 2K / 4K(与比例表对应)。
"high"
画幅比例,如 1:1、16:9、9:16、3:2、4:3、21:9、3:1、1:3 等。与 1K/2K/4K 档位组合时的像素尺寸见 GPT-Image 文档比例表。
3:1, 21:9, 16:9, 3:2, 4:3, 1:1, 3:4, 2:3, 9:16, 1:3, 4:5, 5:4 "1:1"
提供方特定的 image_size 字段(透传,不会改写成 resolution)。
提供方特定的 resolution 字段(与 image_size 独立透传)。
返回 URL 还是 Base64 JSON。支持时默认常为 url。
url, b64_json 风格提示(如 DALL·E 的 vivid / natural)。
背景控制(如 GPT-Image 透明/不透明背景)。
审核级别(模型支持时)。
输出文件格式(如 png、jpeg、webp)。
支持压缩格式时的压缩强度。
渐进/分片出图选项(模型支持时)。
若上游支持流式出图(如部分 GPT-Image),可请求流式事件。
是否请求水印(提供方支持该开关时)。
可选参考图(图生图 / 多图参考)。可为:
- 单个 URL、Base64 或
data:image/...;base64,... - 字符串数组(多张参考图,网关会解析并转发)
带参考图时更完整的编辑能力请用
/v1/images/edits。
终端用户标识(不透明),用于滥用监测。
预留扩展字段。有文档字段时请优先用顶层标准字段。