Configure API keys and environment for Nano Banana
Configures Nano Banana with OpenRouter API key for image and diagram generation.
/plugin marketplace add flight505/nano-banana/plugin install nano-banana@nano-bananaI'll help you configure Nano Banana for image and diagram generation.
Nano Banana requires:
Let me check if you already have the required configuration:
# Check for OPENROUTER_API_KEY
if [ -n "$OPENROUTER_API_KEY" ]; then
echo "✅ OPENROUTER_API_KEY is set in environment"
else
echo "❌ OPENROUTER_API_KEY not found in environment"
fi
# Check for .env file
if [ -f ".env" ] && grep -q "OPENROUTER_API_KEY" .env; then
echo "✅ OPENROUTER_API_KEY found in .env file"
fi
If you don't have an OpenRouter API key:
sk-or-v1-...)Choose ONE of these methods:
Add to your shell profile (~/.zshrc or ~/.bashrc):
export OPENROUTER_API_KEY='sk-or-v1-your-key-here'
Then reload:
source ~/.zshrc # or source ~/.bashrc
Create a .env file in your project root:
echo "OPENROUTER_API_KEY=sk-or-v1-your-key-here" > .env
Important: Add .env to your .gitignore:
echo ".env" >> .gitignore
Pass the key directly:
python generate_diagram.py "My diagram" -o diagram.png --api-key sk-or-v1-your-key-here
No dependency installation required! Nano Banana uses Python stdlib only.
Test that everything works:
# Test diagram generation
python skills/diagram/scripts/generate_diagram.py "Simple flowchart with start, process, and end boxes" -o test_diagram.png --doc-type presentation
# Test image generation
python skills/image/scripts/generate_image.py "A simple blue square" -o test_image.png
If successful, you'll see:
✅ Image saved to: test_diagram.png
After setup, your configuration should look like:
| Component | Status |
|---|---|
| OPENROUTER_API_KEY | ✅ Set (env or .env) |
| Python 3.8+ | ✅ Installed |
| External dependencies | ✅ None required! |
If you want to use .env files, install python-dotenv:
pip install python-dotenv
# or
uv pip install python-dotenv
This is optional - you can also just use exported environment variables.
echo $OPENROUTER_API_KEY.env file exists with the keychmod +x skills/*/scripts/*.py
You're all set! Try these commands:
# Generate an architecture diagram
python skills/diagram/scripts/generate_diagram.py "Microservices architecture with 3 services and a database" -o architecture.png --doc-type architecture
# Generate a creative image
python skills/image/scripts/generate_image.py "A cozy coffee shop interior, warm lighting" -o coffee_shop.png
# Edit an existing image
python skills/image/scripts/generate_image.py "Add rain to the window" --input coffee_shop.png -o rainy_coffee_shop.png
See the skill documentation for more examples:
skills/diagram/SKILL.md - Technical diagram generationskills/image/SKILL.md - Image generation and editingskills/mermaid/SKILL.md - Text-based diagrams