跳转到主要内容
POST
Create image generation
nano-banana-pro 是 DimiLinks 的图片生成模型,按分辨率档位计费。推荐使用异步模式(?async=true),创建后返回 task_id,用 任务查询 轮询并获取成图。

请求地址

文生图示例

参数

价格

价格可能随线上配置调整,运行时以 GET /api/pricing 为准。

下一步

异步模式下保存响应中的 task_id,按 任务查询 轮询至完成并获取图片;同步模式直接返回图片数据。常见错误见 Errors。

授权

Authorization
string
header
必填

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

查询参数

async
boolean

Set to true to submit an async image task.

wait_for_result
boolean

Set to false to submit an async image task.

请求体

application/json
prompt
string
必填
model
string
默认值:gpt-image-2
n
integer
默认值:1

1k resolution allows n=1 only; 2k and 4k allow up to 4.

必填范围: 1 <= x <= 4
size
string
示例:

"1:1"

"16:9"

"3840x2160"

resolution
enum<string>
可用选项:
1k,
2k,
4k
output_format
string
示例:

"png"

"jpeg"

"webp"

output_compression
integer
background
string
示例:

"auto"

"transparent"

"opaque"

moderation
string
示例:

"auto"

"low"

wait_for_result
boolean
image_urls
mask_url
string
response_format
string
示例:

"b64_json"

user
string

响应

Image generation result or async submission

task_id
string
必填
示例:

"task_xxx"

data
object[]
必填
示例:
created
integer
示例:

1777080000