在线服务 · 99.9% 可用 · 平均 312ms

图片 API 站
一毛一张图

一个端口接入 22 款图像模型,按张计费、失败返还、直连免代理。 把生图基础设施留给我们,把好产品留给你。

99.9%
近 30 天可用率
312ms
平均首字节
22款
模型一键切换

Nano Banana 2

★ 主推

第二代绘图模型&4K

2 - 3
积分 / 张
文生图 / 图生图

Nano Banana Pro

精准中文理解输出&4K

2 - 4
积分 / 张
文生图 / 图生图

GPT Image 2

文生图 / 图生图

1 - 3
积分 / 张
文生图 / 图生图
模块一 · 价目表

按积分计费,没有月费

所有模型走同一个接口,换模型只改一个 ID。失败、超时、审核拒绝全部自动返还。

  • GPT Image 2
    gpt-image-2

    文生图 / 图生图

    1 - 3积分 / 张
    最低约 ¥0.125 起
    文生图 / 图生图
  • GPT Image 2.5 Flare 加速NEW
    gpt-image-2.5-flare

    速度优先 · 日常出图与快速原型

    1 - 100积分 / 张
    最低约 ¥0.125 起
    文生图 / 图生图9 档画质
  • GPT Image 2.5 Sunburst 加速
    gpt-image-2.5-sunburst

    编辑精度优先 · 商品图与创意制作

    1 - 100积分 / 张
    最低约 ¥0.125 起
    文生图 / 图生图9 档画质
  • GPT Image 2.5 FlareNEW
    gpt-image-2.5-flare-lite

    图片生成与编辑 · 1K / 2K / 4K · 最多 16 张参考图

    2 - 3积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图
  • GPT Image 2.5 SunburstNEW
    gpt-image-2.5-sunburst-lite

    图片生成与编辑 · 1K / 2K / 4K · 最多 16 张参考图

    2 - 3积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图
  • GPT Image 2.6 Flare 加速NEW
    gpt-image-2.6-flare

    图片生成与编辑 · 最多 16 张参考图 · 蒙版编辑可能改变背景及蒙版外区域

    1 - 100积分 / 张
    最低约 ¥0.125 起
    文生图 / 图生图9 档画质
  • GPT Image 2.6 Sunburst 加速NEW
    gpt-image-2.6-sunburst

    图片生成与编辑 · 1K / 2K / 4K · 最多 16 张参考图

    1 - 100积分 / 张
    最低约 ¥0.125 起
    文生图 / 图生图9 档画质
  • GPT Image 2.6 FlareNEW
    gpt-image-2.6-flare-lite

    图片生成与参考图编辑 · 1K / 2K / 4K · 最多 16 张参考图

    2 - 3积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图
  • GPT Image 2.6 SunburstNEW
    gpt-image-2.6-sunburst-lite

    图片生成与参考图编辑 · 1K / 2K / 4K · 最多 16 张参考图

    2 - 3积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图
  • Z Image TurboNEW
    z-image-turbo

    快速文生图 · 低成本创作

    1积分 / 张
    最低约 ¥0.125 起
    文生图
  • Seedream 5.0NEW
    seedream-5.0

    字节跳动图片生成与编辑模型

    2积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图
  • Seedream 5.0 FlashNEW
    seedream-5.0-flash

    文生图与多图编辑 · 最多 10 张参考图

    2 - 3积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图
  • Seedream 5.0 Pro
    seedream-5.0-pro

    图片生成与编辑 · 1K / 2K · 最多 10 张参考图

    4积分 / 张
    最低约 ¥0.50 起
    文生图 / 图生图
  • Wan2.5 文生图
    wan2.5-text-to-image

    阿里通义万相文生图模型

    2积分 / 张
    最低约 ¥0.25 起
    文生图
  • Qwen Image
    qwen-image-edit-plus

    阿里通义千问图片编辑模型

    2积分 / 张
    最低约 ¥0.25 起
    图生图
  • Nano Banana 2★ 招牌
    nano-banana-2

    第二代绘图模型&4K

    2 - 3积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图联网
  • Nano Banana 2.1 加速★ 招牌NEW
    nano-banana-2.1

    图片生成与编辑 · 1K / 2K / 4K · 最多 14 张参考图

    4 - 5积分 / 张
    最低约 ¥0.50 起
    文生图 / 图生图联网
  • Nano Banana 2.1★ 招牌NEW
    nano-banana-2.1-lite

    图片生成与编辑 · 1K / 2K / 4K · 最多 14 张参考图

    2 - 3积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图
  • Nano Banana Pro★ 招牌
    nano-banana-pro

    精准中文理解输出&4K

    2 - 4积分 / 张
    最低约 ¥0.25 起
    文生图 / 图生图联网
  • GPT Image 2 加速NEW
    gpt-image-2-official

    OpenAI 图像模型 2.0

    1 - 45积分 / 张
    最低约 ¥0.125 起
    文生图 / 图生图9 档画质
  • Nano Banana 2 加速★ 招牌
    nano-banana-2-official

    第二代绘图模型&4K

    4 - 5积分 / 张
    最低约 ¥0.50 起
    文生图 / 图生图联网
  • Nano Banana Pro 加速★ 招牌
    nano-banana-pro-official

    精准中文理解输出&4K

    3 - 6积分 / 张
    最低约 ¥0.38 起
    文生图 / 图生图联网
失败不扣积分。同一 prompt 触发审核失败、超时、网络问题,全部返还。充值额度永不过期 · 开票请联系客服

人民币价格按 ¥999 的 8,000 积分包算(每积分 ¥0.125)。小积分包更贵,每积分最高 ¥0.58,以价格页为准。

模块二 · 接入指南

API Reference

Submit with generate and poll query for asynchronous results. Parameters and available image models follow the site catalog.

Workflow

  1. 1.Submit to /api/ai/generate/ and save data.id as the taskId for queries
  2. 2.Poll /api/ai/query/ until success or failed. Recommended interval: 10 seconds; upstream refreshes for the same task are throttled to 10 seconds
  3. 3.Retrieve the result image URLs from the outputImages field

Authentication

API access is restricted to paid accounts. Recharge first, and send a valid API Key with every request. Historical payment, subscription, renewal or manual recharge qualifies; gifted credits alone do not. A sufficient credit balance is also required.

Authorization: Bearer sk-<your-api-key>
Content-Type: application/json

Uploads use multipart/form-data. Let the client set Content-Type and its boundary automatically; do not use application/json or manually set multipart/form-data without a boundary.

One-click setup: copy a prompt and let AI write the code

Pick how you want to call the API and press the button. We create a dedicated API key, put it into a prompt with the full API details, and your coding assistant writes the submit-and-poll code.

Choose a language
Manage keys

Each press creates a new dedicated key. Above 10 keys the oldest one-click key is revoked automatically (keys you created by hand are never touched); manage them on the API page. The prompt contains your key, so only send it to your own AI tools.

Use it from AI assistants (MCP)

The same API key also connects Cursor, Claude Code, Codex and other MCP clients, so your assistant can look up models, submit generations and fetch images from one request. Read the MCP guide

Available Models

modelNameSupported Scenes
gpt-image-2GPT Image 2
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default 1:1
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • Other supported fields: seed, mask_url
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
  • 4K only supports these aspect ratios: 16:9, 9:16, 2:1, 1:2, 21:9, 9:21
Text-to-image / Image-to-image
gpt-image-2.5-flareGPT Image 2.5 Flare 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–4; default 1
  • Other supported fields: output_format (png, jpeg, webp), output_compression, background, moderation (auto, low)
  • options.size or options.aspectRatio accepts WIDTHxHEIGHT, e.g. 1024x1024; send only one. Positive dimensions must be divisible by 16, each at most 3840, total pixels between 655360 and 8294400, longest/shortest edge ratio at most 3
Text-to-image / Image-to-image
gpt-image-2.5-sunburstGPT Image 2.5 Sunburst 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–4; default 1
  • Other supported fields: mask_url, output_format (png, jpeg, webp), output_compression, background, moderation (auto, low)
  • options.size or options.aspectRatio accepts WIDTHxHEIGHT, e.g. 1024x1024; send only one. Positive dimensions must be divisible by 16, each at most 3840, total pixels between 655360 and 8294400, longest/shortest edge ratio at most 3
Text-to-image / Image-to-image
gpt-image-2.5-flare-liteGPT Image 2.5 Flare
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–4; default 1
  • Other supported fields: mask_url, output_format (png, jpeg, webp), output_compression, background, moderation (auto, low)
  • options.size or options.aspectRatio accepts WIDTHxHEIGHT, e.g. 1024x1024; send only one. Positive dimensions must be divisible by 16, each at most 3840, total pixels between 655360 and 8294400, longest/shortest edge ratio at most 3
Text-to-image / Image-to-image
gpt-image-2.5-sunburst-liteGPT Image 2.5 Sunburst
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–4; default 1
  • Other supported fields: mask_url, output_format (png, jpeg, webp), output_compression, background, moderation (auto, low)
  • options.size or options.aspectRatio accepts WIDTHxHEIGHT, e.g. 1024x1024; send only one. Positive dimensions must be divisible by 16, each at most 3840, total pixels between 655360 and 8294400, longest/shortest edge ratio at most 3
Text-to-image / Image-to-image
gpt-image-2.6-flareGPT Image 2.6 Flare 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–4; default 1
  • Other supported fields: mask_url, output_format (png, jpeg, webp), output_compression, background, moderation (auto, low)
  • options.size or options.aspectRatio accepts WIDTHxHEIGHT, e.g. 1024x1024; send only one. Positive dimensions must be divisible by 16, each at most 3840, total pixels between 655360 and 8294400, longest/shortest edge ratio at most 3
Text-to-image / Image-to-image
gpt-image-2.6-sunburstGPT Image 2.6 Sunburst 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–4; default 1
  • Other supported fields: mask_url, output_format (png, jpeg, webp), output_compression, background, moderation (auto, low)
  • options.size or options.aspectRatio accepts WIDTHxHEIGHT, e.g. 1024x1024; send only one. Positive dimensions must be divisible by 16, each at most 3840, total pixels between 655360 and 8294400, longest/shortest edge ratio at most 3
Text-to-image / Image-to-image
gpt-image-2.6-flare-liteGPT Image 2.6 Flare
  • aspectRatio: auto, 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 21:9; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–1; default 1
  • Other supported fields: output_format (png, jpeg, webp)
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
gpt-image-2.6-sunburst-liteGPT Image 2.6 Sunburst
  • aspectRatio: auto, 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 21:9; default auto
  • resolution: 1k, 2k, 4k; default 1k
  • At most 10 references (including site precheck limits)
  • quality: auto, low, medium, high, xhigh, max; send explicitly
  • count: 1–1; default 1
  • Other supported fields: output_format (png, jpeg, webp)
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
z-image-turboZ Image Turbo
  • aspectRatio: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3; default 1:1
  • resolution: 1K, 2K; default 1K
  • At most 0 references (including site precheck limits)
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image
seedream-5.0Seedream 5.0
  • aspectRatio: auto, 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9; default 1:1
  • resolution: 2K, 3K; default 2K
  • At most 10 references (including site precheck limits)
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
seedream-5.0-flashSeedream 5.0 Flash
  • aspectRatio: auto, 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 2:1, 1:2; default auto
  • resolution: 1K, 1.5K, 2K; default 1K
  • At most 10 references (including site precheck limits)
  • count: 1–1; default 1
  • Other supported fields: output_format (jpeg, png), watermark
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
seedream-5.0-proSeedream 5.0 Pro
  • aspectRatio: auto, 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9; default auto
  • resolution: 1K, 2K; default 1K
  • At most 10 references (including site precheck limits)
  • count: 1–1; default 1
  • Other supported fields: output_format (jpeg, png), watermark
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
wan2.5-text-to-imageWan2.5 文生图
  • aspectRatio / resolution are not exposed; upstream size defaults apply
  • At most 0 references (including site precheck limits)
Text-to-image
qwen-image-edit-plusQwen Image
  • aspectRatio / resolution are not exposed; upstream size defaults apply
  • At most 1 references (including site precheck limits)
Image-to-image
nano-banana-2Nano Banana 2
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1; default 1:1
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • web_search supported; adds 1 credits per image when enabled
  • Other supported fields: seed, mask_url
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
nano-banana-2.1Nano Banana 2.1 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1; default auto
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • web_search supported; adds 1 credits per image when enabled
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
nano-banana-2.1-liteNano Banana 2.1
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1; default auto
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • count: 1–1; default 1
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
nano-banana-proNano Banana Pro
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9; default 1:1
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • Other supported fields: seed, mask_url
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
gpt-image-2-officialGPT Image 2 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 2:1, 1:2, 3:1, 1:3, 9:21; default 1:1
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • quality: low, medium, high; send explicitly
  • Other supported fields: seed, mask_url
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
  • 4K only supports these aspect ratios: 16:9, 9:16, 2:1, 1:2, 21:9, 9:21
Text-to-image / Image-to-image
nano-banana-2-officialNano Banana 2 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1; default 1:1
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • web_search supported; adds 1 credits per image when enabled
  • Other supported fields: seed, mask_url
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image
nano-banana-pro-officialNano Banana Pro 加速
  • aspectRatio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9; default 1:1
  • resolution: 1K, 2K, 4K; default 1K
  • At most 10 references (including site precheck limits)
  • Other supported fields: seed, mask_url
  • options.size is only an aspectRatio alias for ratios; pixel dimensions such as 1024x1024 are not accepted. Use the listed ratios and resolution tiers; exact output pixels are not guaranteed
Text-to-image / Image-to-image

Only site-enabled image models are listed. Use the per-model supported fields; unlisted capabilities are not guaranteed. Reference limits reflect both model and site prechecks. Upstream quality defaults vary; send quality explicitly. Use the exact listed resolution and ratio values.

POST/api/storage/upload-imageUpload local reference images and obtain URLs for image-to-image requests. Authenticate with the same API Key used for generation.

Upload Parameters

FieldTypeRequiredDescription
filesFile[]✓Required image files with image/* MIME types, such as image/png, image/jpeg or image/webp. Repeat the files field to upload multiple images.

Uploads use multipart/form-data. Let the client set Content-Type and its boundary automatically; do not use application/json or manually set multipart/form-data without a boundary.

Upload Examples

curl -X POST https://www.nano-banana.cn/api/storage/upload-image \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "files=@./reference.png" \
  -F "files=@./reference-2.jpg"

Upload Response and Image-to-Image Usage

{
  "code": 0,
  "message": "ok",
  "data": {
    "urls": [
      "https://r2.nano-banana.cn/uploads/example.png"
    ],
    "results": [
      {
        "url": "https://r2.nano-banana.cn/uploads/example.png",
        "key": "uploads/example.png",
        "filename": "reference.png"
      }
    ]
  }
}

data.urls contains image URLs in upload order. data.results contains each file’s url, storage key and original filename. The example domain is illustrative; use the URLs returned by the API.

Pass data.urls as options.image_urls to POST /api/ai/generate/ and set scene to image-to-image. Reference count, format and size must satisfy the selected model and site prechecks.

Check the business code as well as the HTTP status: 0 means success and -1 means failure. Common errors include no auth, please sign in, No files provided, File … is not an image, and upload image failed. If a multi-file upload fails partway through, earlier files may already be stored. Only use the complete URL array when code is 0.

POST/api/ai/generate/Submit an asynchronous image task. The response contains data.id; use that value as taskId in the query request.

Request Parameters

FieldTypeRequiredDescription
mediaTypestring✓Fixed value: "image"
modelstring✓Model identifier — see available models above
promptstring✓Nonempty text prompt; whitespace-only prompts are rejected. Subject to content moderation.
scenestringOptional: text-to-image or image-to-image; defaults to text-to-image. For editing, use image-to-image with references. Supported scenes vary by model.
optionsobjectOptional model options object. Defaults and supported fields are listed per model below. Unsupported fields may be ignored or rejected.
options.aspectRatiostringAspect ratio. Allowed values and defaults are listed per model; auto is only available where listed. This field is separate from resolution.
options.sizestringCompatibility alias for aspectRatio, nested under options. Top-level size has no effect. Send only size or aspectRatio; when both are present aspectRatio usually wins, while some models reject the combination. GPT Image 2 and its accelerated variant reject pixel dimensions: use options: {"aspectRatio":"1:1","resolution":"1K"}, which does not guarantee an exact 1024×1024 output. GPT Image 2.5 Flare / Sunburst accept options: {"size":"1024x1024"}. Full requests still require mediaType, model and prompt. See per-model dimension limits.
options.resolutionstringResolution tier. Use the exact spelling and case listed per model, such as 1K or 1k. See model notes for defaults and aspect-ratio restrictions.
options.qualitystringImage quality, separate from resolution. Only supported where quality is listed below; values vary by model. Send explicitly. Some models charge by quality × resolution; omitted quality is billed at the low tier.
options.image_urlsstring[]Array of HTTP/HTTPS reference URLs accessible to the server. Local paths and Base64 are not accepted. See per-model limits; site prechecks accept at most 10 distinct URLs. Image-only editing models require references; text-only models reject them.
options.web_searchbooleanBoolean search toggle; send false or true explicitly. Only available where web_search is listed. Additional credits may apply as shown per model.
options.count / options.nintegerPositive integer output count, default 1. count and n are aliases; count takes precedence, so send only one. Only use on models listing count. Usually capped at 4; some models allow only 1. Credits equal the unit price × requested count. Omit on unsupported models.
options.seedintegerInteger random seed, only where seed is listed. Omit to let the upstream choose. Identical outputs across calls or channels are not guaranteed.
options.negative_promptstringOptional negative prompt forwarded upstream; effectiveness depends on the model. nano-banana-2.1 rejects this field. Do not send it unconditionally.
options.mask_urlstringHTTP/HTTPS mask URL, only where mask_url is listed. A reference image is also required. Mask format, dimensions and edit-region semantics depend on the model.
options.output_formatstringOutput format, only where output_format is listed. Allowed values appear per model. Omit for the upstream default.
options.output_compressionintegerInteger compression quality from 0 to 100, only where listed. Requires an explicit output_format of jpeg or webp.
options.backgroundstringBackground mode: auto, transparent or opaque, only where listed. Transparency also depends on the output format and upstream support.
options.moderationstringUpstream moderation mode, only where listed. See per-model allowed values. Does not disable site content checks.
options.watermarkbooleanBoolean upstream watermark toggle, only where listed. Omit for the upstream default.

Example (curl)

# 提交一个生图任务
curl -X POST https://www.nano-banana.cn/api/ai/generate/ \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "mediaType": "image",
    "model": "nanobanana-2",
    "prompt": "a cute panda eating bamboo",
    "scene": "text-to-image",
    "options": { "aspectRatio": "1:1" }
  }'

# 响应
# { "code": 0, "message": "ok", "data": { "id": "3f2a1b4c-...", "status": "queuing", "costCredits": 2 } }

Image editing example: separate quality and resolution

{
  "mediaType": "image",
  "model": "gpt-image-2-official",
  "prompt": "Replace the background with a white studio backdrop",
  "scene": "image-to-image",
  "options": {
    "image_urls": [
      "https://your-server.com/reference.png"
    ],
    "aspectRatio": "16:9",
    "resolution": "2K",
    "quality": "medium"
  }
}

Response Example

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "3f2a1b4c-...",
    "status": "queuing",
    "costCredits": 2
  }
}

Limits and account requirements

API calls require a paid account; captchaToken is not required and CAPTCHA cannot replace paid eligibility. Unpaid accounts receive paid account required for API access. Webhook callbacks are currently unsupported; callbackUrl has no effect. Poll query instead. Keep reference images within 20MB each and provide accessible original URLs. Replace the example reference URL with a real image.

POST/api/ai/query/Query using data.id from submission, preferably every 10 seconds. More frequent calls may return cached status. Stop at success or failed. Check code before accessing data; on nonzero code, read message.

Request Parameters

FieldTypeRequiredDescription
taskIdstring✓The submission response data.id (site task ID), not the upstream provider taskId. Only tasks owned by the current account can be queried.

Example (curl)

# 轮询任务结果
curl -X POST https://www.nano-banana.cn/api/ai/query/ \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{ "taskId": "3f2a1b4c-..." }'

# 处理中响应
# { "code": 0, "data": { "id": "...", "status": "processing", "outputImages": null } }

# 成功响应
# { "code": 0, "data": { "id": "...", "status": "success", "outputImages": ["https://r2.nano-banana.cn/outputs/xxx.png"] } }

In-progress Response

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "3f2a1b4c-...",
    "status": "processing",
    "outputImages": null
  }
}

Success Response

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "3f2a1b4c-...",
    "status": "success",
    "outputImages": [
      "https://r2.nano-banana.cn/outputs/xxx.png"
    ]
  }
}

Task Status

statusDescription
queuingQueued, waiting to be processed
pendingSubmitted to AI provider, awaiting response
processingBeing processed by AI provider
successGeneration succeeded — outputImages contains the result URLs
failedGeneration failed — credits have been automatically refunded

Error Responses

Check code first: 0 means success and -1 means failure. On failure, read message instead of accessing data. paid account required for API access means the account lacks paid eligibility; insufficient credits means the available balance is too low.

{
  "code": -1,
  "message": "insufficient credits"
}
  • no authAPI Key is invalid or missing
  • insufficient creditsInsufficient credits
  • task not foundTask does not exist
  • no permissionNot authorized to access this task (belongs to another user)
模块三 · 你的密钥

一键创建 API Key

无需跳转,直接在当前页面创建并复制密钥。每个账号最多 10 个 Key,可分别用于不同项目方便撤销。

登录后即可创建 API Key

登录账号即可创建并管理 API Key

前往登录
模块四 · 常见问题

开发者常问的 12 件事

没找到答案?微信加 banana-cs 工作时间 5 分钟内回复。

别再看了,
动手试试。

按张计费、随用随充,余额永不过期。

按张计费 · 失败返还 · 5 分钟上手