跳转到内容
NewRouters/开发者文档
图片模型 API

nano-banana-pro · API 接入

通过媒体任务接口接入 nano-banana-pro。 包含请求示例、参数、鉴权和结果处理。

POST/v1/tasksMODELnano-banana-pro
官方对应 gemini-3-pro-image核对 2026-09-27官方资料
代码示例与响应
请求与响应代码示例
POST/v1/tasks
服务端调用
curl "https://newrouters.com/v1/tasks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  --data '{
  "model": "nano-banana-pro",
  "input": {
    "resolution": "1k",
    "aspect_ratio": "auto",
    "output_format": "jpeg",
    "prompt": "A small red house in a quiet garden",
    "images": []
  }
}'

平台地址已填入,运行前设置 API_KEY 环境变量。示例不会自动发起请求。

响应字段节选 · 示意值
202任务已受理
JSON
{
  "id": "TASK_ID",
  "status": "pending",
  "model": "nano-banana-pro",
  "result": null,
  "error": null
}
200成功结果
JSON
{
  "id": "TASK_ID",
  "status": "succeeded",
  "model": "nano-banana-pro",
  "result": {
    "assets": [
      "https://example.com/output.png"
    ]
  },
  "error": null
}
创建后如何查询结果
调用流程异步媒体任务
  1. 创建任务01
    POST /v1/tasks

    提交 model + input,保存返回的任务 id。

    202 · pending
  2. 轮询状态02
    GET /v1/tasks/{id}

    pending / processing 时等待并继续查询。

    等待 → 再查询
  3. 读取终态03
    result.assets[] / error

    按任务终态读取对应结果。

    succeeded→ assetsfailed→ error

示例输出

在模型页查看与试用 ↗

以下结果均通过本平台 API 实际生成,费用为任务回执中的实扣金额。

数据准确的信息图
数据准确的信息图$0.06
提示词与参数

A refined editorial infographic poster titled "The Perfect Pour-Over". Clean dark charcoal background, cream and copper palette. Sections with exact labels and numbers: "Dose 15 g", "Water 250 g", "Ratio 1:16.7", "Temperature 93 °C", "Grind Medium-fine", "Bloom 30 s", "Total time 3:00". A precise cross-section illustration of a cone dripper with water flow arrows, and a simple timeline bar from 0:00 to 3:00 marking Bloom, First pour, Second pour, Drawdown. Swiss editorial typography, perfectly aligned grid, all text spelled exactly as written, no other text.

aspect_ratio: 3:4 · resolution: 2k · output_format: jpeg
品牌包装系统
品牌包装系统$0.06
提示词与参数

A premium brand packaging mockup for a fictional Chinese tea brand "山岚 SHANLAN". On a misty grey stone surface: a tall cylindrical tea tin, a matte paper pouch, a small gift box and a ceramic cup. Each item carries the logo "山岚" in elegant brush calligraphy and "SHANLAN TEA" in thin spaced capitals, plus a small label "Mountain Oolong · 高山乌龙 · 100g". Muted celadon, ink black and warm paper tones, soft diffused light, photorealistic. All text exactly as written.

aspect_ratio: 4:3 · resolution: 2k · output_format: jpeg
4K 微距细节
4K 微距细节$0.10
提示词与参数

Extreme macro photograph of an open mechanical watch movement: polished gears, blued screws, ruby jewels, a swinging balance wheel and fine Geneva stripes on the bridges. Razor-sharp focus stacking, warm workshop light from the left, deep black background, physically accurate metal reflections.

aspect_ratio: 16:9 · resolution: 4k · output_format: jpeg
路由之城
路由之城$0.06
提示词与参数

High-altitude oblique aerial view of a vast city at night rendered almost entirely dark, its street grid barely visible. A few dozen bright routes of warm gold light flow along the streets from many districts and converge into one luminous central plaza, then fan out again as fine white lines. Atmospheric haze, curvature of distant horizon, subtle cyan city glow on the far edge. Wide cinematic 16:9 frame. The subject sits in the right 60 percent of the frame; the left 40 percent is calm, deep near-black negative space reserved for a headline. Restrained palette: near-black #08090a, warm gold #f0b429 highlights, soft white and a hint of cool cyan. Photoreal, premium, minimal, physically plausible light, fine detail, gentle film grain. No text, no letters, no logos, no UI, no people.

aspect_ratio: 16:9 · resolution: 2k · output_format: jpeg

API 模型 ID 为 nano-banana-pro。本文说明平台的实际契约,调用前请核对实时目录中的可用性。

平台地址在构建时填入,运行前设置 API_KEY 为服务端密钥。

终端窗口
curl "https://newrouters.com/v1/tasks" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
--data '{
"model": "nano-banana-pro",
"input": {
"resolution": "1k",
"aspect_ratio": "auto",
"output_format": "jpeg",
"prompt": "A small red house in a quiet garden",
"images": []
}
}'

创建响应表示任务已受理,不是最终结果。用返回的 ID 替换 TASK_ID,轮询至 succeeded 或 failed。

终端窗口
curl "https://newrouters.com/v1/tasks/TASK_ID" \
-H "Authorization: Bearer $API_KEY"

成功查看 result,失败查看 error。上游结果未知时保留原任务 ID,不盲目重复提交付费生成。

字段类型要求默认值限制
imagesarray可选[]—
promptstring必填—最大长度 100000
resolutionenum可选"1k"1k, 2k, 4k
aspect_ratioenum可选"auto"auto, 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
output_formatenum可选"jpeg"png, jpeg, webp

核对日期: 2026-09-27 · 平台模型: nano-banana-pro · 官方对应: gemini-3-pro-image

接入时核对当前可用性、契约和账号价格。排错时保留请求 ID 与消费凭据。 完整 API 参考