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

图片 API 站
一毛一张图

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

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

Nano Banana 2

★ 主推new

第二代绘图模型&4K

2 - 6
积分 / 张
文生图 / 图生图支持加速档

Nano Banana Pro

精准中文理解输出&4K

2 - 6
积分 / 张
文生图 / 图生图支持加速档

GPT Image 2.0

new

OpenAI 图像模型 2.0

1 - 45
积分 / 张
文生图 / 图生图支持加速档9 档画质×分辨率
模块一 · 价目表

按积分计费,没有月费

招牌的 Nano Banana 系列单价最低、出图最快;其余 6 款按场景按需选用。失败、超时、审核拒绝全部自动返还。

  • GPT Image 2.0NEW
    gpt-image-2

    OpenAI 图像模型 2.0

    1 - 45积分 / 张
    文生图 / 图生图加速档9 档画质
  • Nano Banana 2★ 招牌NEW
    nanobanana-2

    第二代绘图模型&4K

    2 - 6积分 / 张
    文生图 / 图生图加速档联网
  • Nano Banana Pro★ 招牌
    nano-banana-pro

    精准中文理解输出&4K

    2 - 6积分 / 张
    文生图 / 图生图加速档联网
  • Z Image Turbo
    z-image-turbo

    文生图

    1积分 / 张
    文生图
  • Seedream 5.0NEW
    seedream-5.0

    响应更精准,效果更智能

    2积分 / 张
    文生图 / 图生图
  • Wan2.5 Text to Image
    wan2.5-text-to-image

    文生图

    2积分 / 张
    文生图
  • Qwen Image
    qwen-image-edit-plus

    图生图

    2积分 / 张
    图生图
  • GPT Image 1.5
    gpt-image-1.5

    文生图 / 图生图

    8积分 / 张
    文生图 / 图生图
失败不扣积分。同一 prompt 触发审核失败、超时、网络问题,全部返还。充值额度永不过期 · 支持开发票
模块二 · 接入指南

API Reference

任务异步处理:generate 提交、query 轮询,也可用 callbackUrl 改为回调推送。所有内容与控制台 /settings/apikeys 接口文档完全同源。

Workflow

  1. 1.Call /api/ai/generate/ to submit a generation task and receive a taskId
  2. 2.Poll /api/ai/query/ until status becomes success or failed (recommended interval: 2–5 seconds)
  3. 3.Retrieve the result image URLs from the outputImages field

Authentication

All API calls require an API Key in the request header:

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

Available Models

modelNameSupported Scenes
gpt-image-2GPT Image 2.0Text-to-image / Image-to-image
nanobanana-2Nano Banana 2Text-to-image / Image-to-image
nano-banana-proNano Banana ProText-to-image / Image-to-image
z-image-turboZ Image TurboText-to-image
seedream-5.0Seedream 5.0Text-to-image / Image-to-image
wan2.5-text-to-imageWan2.5 Text to ImageText-to-image
qwen-image-edit-plusQwen ImageImage-to-image
gpt-image-1.5GPT Image 1.5Text-to-image / Image-to-image

text-to-image = generate from text prompt; image-to-image = edit or transform an input image

POST/api/ai/generate/Submit an AI image generation task. Returns a taskId immediately; processing is asynchronous. Poll /api/ai/query/ for results.

Request Parameters

FieldTypeRequiredDescription
mediaTypestringFixed value: "image"
modelstringModel identifier — see available models above
promptstringText prompt for generation
scenestringDefault: text-to-image. Use image-to-image for image editing
options.aspectRatiostringAspect ratio, e.g. "1:1", "16:9", "9:16"
options.resolutionstringResolution tier, e.g. "1K", "2K", "4K"
options.speed_modestring"seed" (accelerated) or "noseed" (standard). Supported on select models only
options.image_urlsstring[]Array of input image URLs, used in image-to-image scene
callbackUrlstringOptional HTTPS URL to receive a callback when the task completes or fails. A POST request with the task result will be sent to this address

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",
    "callbackUrl": "https://your-server.com/callback",
    "options": { "aspectRatio": "1:1" }
  }'

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

Response Example

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

Callback Notification

If callbackUrl is provided, a single POST request will be sent to that URL when the task finishes (success or failure):

Callback Payload Example
{
  "id": "3f2a1b4c-...",
  "status": "success",
  "outputImages": [
    "https://r2.nano-banana.cn/outputs/xxx.png"
  ]
}
POST/api/ai/query/Query task status and results. Poll every 2–5 seconds until status is success or failed.

Request Parameters

FieldTypeRequiredDescription
taskIdstringTask ID returned by /api/ai/generate/

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

On failure, code is -1 and message describes the error:

{
  "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 分钟上手

香蕉 OpenAPI · 一行代码接入 8 款顶级图像模型