gemini-api
Google Gemini 3 Pro Image API reference. Covers text-to-image, editing, reference images, aspect ratios, and error handling.
Install
mkdir -p .claude/skills/gemini-api && curl -L -o skill.zip "https://mcp.directory/api/skills/download/5115" && unzip -o skill.zip -d .claude/skills/gemini-api && rm skill.zipInstalls to .claude/skills/gemini-api
About this skill
plugin: nanobanana updated: 2026-01-20
Gemini Image API Reference
Quick Start
# Set API key
export GEMINI_API_KEY="your-key"
# Generate image
uv run python main.py output.png "A minimal 3D cube"
API Key Setup
- Visit: https://makersuite.google.com/app/apikey
- Create new API key
- Set environment variable:
export GEMINI_API_KEY="your-api-key"
Supported Models
| Model | Resolution | Best For |
|---|---|---|
| gemini-3-pro-image-preview | Up to 4K | High quality |
| gemini-2.5-flash-image | Up to 1K | Quick iterations |
Aspect Ratios
| Ratio | Use Case |
|---|---|
| 1:1 | Social media, icons |
| 3:4 | Portrait photos |
| 4:3 | Traditional photos |
| 4:5 | Instagram portrait |
| 5:4 | Landscape photos |
| 9:16 | Mobile, stories |
| 16:9 | YouTube, desktop |
| 21:9 | Cinematic, ultrawide |
CLI Flags
| Flag | Description | Example |
|---|---|---|
--style | Apply style template | --style styles/glass.md |
--edit | Edit existing image | --edit photo.jpg |
--ref | Reference image | --ref style.png |
--aspect | Aspect ratio | --aspect 16:9 |
--model | Model ID | --model gemini-2.5-flash-image |
--max-retries | Retry attempts | --max-retries 5 |
Error Codes
| Code | Meaning | Recovery |
|---|---|---|
SUCCESS | Operation completed | N/A |
API_KEY_MISSING | GEMINI_API_KEY not set | Export the variable |
FILE_NOT_FOUND | Referenced file missing | Check path |
INVALID_INPUT | Bad prompt or argument | Fix input |
RATE_LIMITED | Too many requests | Wait, uses auto-retry |
NETWORK_ERROR | Connection failed | Check network, auto-retry |
API_ERROR | Gemini API error | Check logs |
CONTENT_POLICY | Blocked prompt | Adjust content |
TIMEOUT | Request timed out | Retry |
PARTIAL_FAILURE | Some batch items failed | Check individual results |
Retry Behavior
The script automatically retries on transient errors:
- Rate limits (429)
- Server errors (502, 503)
- Connection timeouts
- Network errors
Retry uses exponential backoff: 1s, 2s, 4s, 8s, etc.
Maximum retries configurable with --max-retries (default: 3)
Best Practices
- Prompts: Be specific about style, lighting, composition
- Styles: Use markdown templates for consistent results
- References: Provide visual examples for style matching
- Batch: Generate variations to pick the best
- Iteration: Edit results to refine
- Retries: Increase
--max-retriesfor unreliable connections
More by MadAppGang
View all skills by MadAppGang →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversGenerate and edit images from text with Nano-Banana, an AI image generator powered by Gemini 2.5 Flash. Fast, seamless,
Gemini Image Generator uses AI to create images with prompt enhancement, character consistency, and multi-image blending
AI Vision uses Google Cloud Vertex AI to analyze images and videos, leveraging intelligent file handling for optimized u
Leverage Google AI Studio & Gemini API to process images, videos, audio, PDFs, & text for document conversion, analysis
Gemini Nanobanana: AI image generator for creating, editing, and composing stunning images using advanced artificial int
Generate stunning AI images with ImageGen, a unified AI image generator supporting DALL-E, Gemini & more, with smart par
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.