📦 Nano Banana API — Nano工具

v0.1.1

Generate images through the Nano Banana 图像工具 REST API and help agents integrate or operate the service safely. Use when a task involves 文生图, image-to-im...

0· 138·1 当前·1 累计
by @sdhjkagbjksg (Nano Banana API)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/26
0
安全扫描
VirusTotal
Pending
查看报告
OpenClaw
安全
high confidence
The skill appears to do exactly what it says (wrap the Nano Banana image-generation REST API), requests only the expected API key and python3, and its included script and docs are consistent with that purpose.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv0.1.12026/3/25

Add official website to skill docs and fix image downloads by sending an explicit User-Agent.

Pending

安装命令

点击复制
官方npx clawhub@latest install nano-banana-api
🇨🇳 镜像加速npx clawhub@latest install nano-banana-api --registry https://cn.longxiaskill.com

技能文档

Use this skill when an agent needs to call Nano Banana directly instead of only editing docs.

Official website: https://www.nananobanana.com

Quick 开始

Set an API key with NANO_BANANA_API_KEY or NB_API_KEY.

Use the bundled CLI for repeatable calls:

python3 scripts/nano_banana_api.py models
python3 scripts/nano_banana_api.py credits
python3 scripts/nano_banana_api.py generate --prompt "A cinematic orange cat on a train" --mode sync
python3 scripts/nano_banana_api.py generate --prompt "Replace the background with a beach" --reference-image-url https://example.com/image.jpg --mode async --wait
python3 scripts/nano_banana_api.py generate --prompt "A cyberpunk skyline at night" --mode stream

Workflow

  • Call models 第一个 当...时 模型 name matters.
  • Omit --模型 unless 用户 explicitly asks 对于 specific 模型.
  • Choose 请求 mode 由 interaction pattern:
- 同步: simplest 请求/响应 flow. - stream: real-时间 progress 通过 SSE. - 异步: immediate submission 加上 later polling.
  • 使用 poll --id --wait 当...时 异步 task 必须 followed 到 completion.
  • 下载 images 期间 相同 会话 当...时 用户 wants local files. 输出 URLs expire 之后 15 days.

Operational Rules

  • 做 不 打印 或 restate raw API 键.
  • Prefer models 在...上 hardcoding catalog values. live 模型 列表 changes 和 source 的 truth.
  • 如果 docs 和 live API behavior disagree, trust live endpoints 和 mention 日期 的 verification.
  • Treat 401, 402, 403, 和 503 作为 actionable operational states:
- 401: 无效 或 missing 键. - 402: insufficient credits. - 403: 账户 做 不 有 API access 已启用. - 503: 异步 队列 busy; 重试 later.
  • 对于 stream, expect newline-delimited SSE data: events.
  • 对于 异步, 仅 declare 成功 之后 processingStatus becomes 已完成.

Command Guide

列表 models

python3 scripts/nano_banana_api.py models

Use this before selecting --model. Live verification on 2026-03-25 showed model names that differ from examples in the docs, so avoid assuming nano-banana is the current explicit model ID.

Check credits

python3 scripts/nano_banana_api.py credits

Generate synchronously

python3 scripts/nano_banana_api.py generate \
  --prompt "A watercolor mountain village at sunrise" \
  --mode sync \
  --download-dir ./outputs

Generate asynchronously 和 wait

python3 scripts/nano_banana_api.py generate \
  --prompt "A product hero shot of a banana-shaped lamp" \
  --mode async \
  --wait \
  --poll-interval 3 \
  --max-polls 60

关注 existing 任务

python3 scripts/nano_banana_api.py poll --id clxx123 --wait

Generate 从 reference image

python3 scripts/nano_banana_api.py generate \
  --prompt "Keep the subject, turn the room into a brutalist gallery" \
  --reference-image-url https://example.com/source.jpg \
  --mode sync

Fallback 没有 Script

If direct shell execution is unavailable, construct HTTP calls from references/api-reference.md. Use:

  • POST /generate 对于 同步, stream, 或 异步 submission.
  • 获取 /generate?id=... 对于 polling.
  • 获取 /models 到 resolve current 模型 names.
  • 获取 /credits 到 inspect balance.

Resources

数据来源:ClawHub ↗ · 中文优化:龙虾技能库