OmwAIOmwAI
API GuideAPI ReferenceProgramming Tools
Nano Banana Pro

Image Generation (Async)

Nano Banana Pro async image generation endpoint

The Nano Banana Pro async image generation endpoint. Submits a generation task from a prompt. The interface is async: on success it returns an image.task object; poll the Query Result endpoint with the returned task ID until status becomes completed to fetch the final image.

Billing model

This endpoint is billed under the nano-banana-pro model. Configure a group price for it on the channel, and your token must be allowed to use that model's group.

Async flow

  1. POST /v1/images/async/generations submits the task and returns task_id (prefixed with task_) and status=queued/in_progress;
  2. Poll GET /v1/images/async/generations/{task_id} with that task_id;
  3. When status=completed, the data array contains the final image (b64_json Base64); when failed, error explains why.

Image-to-image (reference images)

This endpoint also supports image-to-image: pass reference images in the images array (each item a public image URL or a Base64 data URI) and describe the keep/edit instructions in prompt. For a single reference image you can also use the image field with one string. Image-to-image uses the same submit & query flow, endpoint, and billing model as text-to-image.

Use the request example selector below the endpoint (Text-to-image / Image-to-image) to switch between the two request bodies; the reference image is passed in via images.

POST
/v1/images/async/generations

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx 令牌需开通对应模型的调用权限。

In: header

Request Body

application/json

model*string

模型名称

prompt*string

提示词,描述希望生成的图片内容

images?array<string>

参考图列表(图生图)。每项为图片 URL(http/https)或 Base64 data URI,配合 prompt 描述修改要求。仅一张时也可用 image 字段传单个字符串

image?string

单张参考图(图生图),参考图 URL 或 Base64 data URI。多张请用 images 数组

n?integer

生成数量(1-128),默认 1

Range1 <= value <= 128
size?string

图片尺寸,如 1024x1024、1536x1024、1024x1536 等

quality?string

画质等级:low / medium / high / auto

background?string

背景:transparent / opaque / auto / none

output_format?string

输出格式:png / jpeg / webp

moderation?string

内容审核:auto / low / high

user?string

终端用户标识,用于审计与追踪

Response Body

application/json

application/json

curl -X POST "https://www.omwai.xyz/v1/images/async/generations" \  -H "Content-Type: application/json" \  -d '{    "model": "nano-banana-pro",    "prompt": "a cute cat, cyberpunk style, neon background",    "size": "1024x1024",    "quality": "high"  }'
{
  "id": "task_01J8ABCDEFGHIJKLMNOPQRST",
  "task_id": "task_01J8ABCDEFGHIJKLMNOPQRST",
  "object": "image.task",
  "model": "nano-banana-pro",
  "status": "queued",
  "progress": "0%",
  "created_at": 1788256630,
  "completed_at": 1788256720,
  "error": {
    "code": "string",
    "message": "string"
  },
  "data": [
    {
      "b64_json": "string",
      "revised_prompt": "string"
    }
  ]
}
{
  "code": "string",
  "message": "string"
}

Note

A successful submission (HTTP 200) only means the task was accepted, not that the image is ready. Always poll the query endpoint until status=completed.

How is this guide?

Last updated on