gemini-api

1
1
Source

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.zip

Installs 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

  1. Visit: https://makersuite.google.com/app/apikey
  2. Create new API key
  3. Set environment variable:
    export GEMINI_API_KEY="your-api-key"
    

Supported Models

ModelResolutionBest For
gemini-3-pro-image-previewUp to 4KHigh quality
gemini-2.5-flash-imageUp to 1KQuick iterations

Aspect Ratios

RatioUse Case
1:1Social media, icons
3:4Portrait photos
4:3Traditional photos
4:5Instagram portrait
5:4Landscape photos
9:16Mobile, stories
16:9YouTube, desktop
21:9Cinematic, ultrawide

CLI Flags

FlagDescriptionExample
--styleApply style template--style styles/glass.md
--editEdit existing image--edit photo.jpg
--refReference image--ref style.png
--aspectAspect ratio--aspect 16:9
--modelModel ID--model gemini-2.5-flash-image
--max-retriesRetry attempts--max-retries 5

Error Codes

CodeMeaningRecovery
SUCCESSOperation completedN/A
API_KEY_MISSINGGEMINI_API_KEY not setExport the variable
FILE_NOT_FOUNDReferenced file missingCheck path
INVALID_INPUTBad prompt or argumentFix input
RATE_LIMITEDToo many requestsWait, uses auto-retry
NETWORK_ERRORConnection failedCheck network, auto-retry
API_ERRORGemini API errorCheck logs
CONTENT_POLICYBlocked promptAdjust content
TIMEOUTRequest timed outRetry
PARTIAL_FAILURESome batch items failedCheck 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

  1. Prompts: Be specific about style, lighting, composition
  2. Styles: Use markdown templates for consistent results
  3. References: Provide visual examples for style matching
  4. Batch: Generate variations to pick the best
  5. Iteration: Edit results to refine
  6. Retries: Increase --max-retries for unreliable connections

claudish-usage

MadAppGang

CRITICAL - Guide for using Claudish CLI ONLY through sub-agents to run Claude Code with any AI model (OpenRouter, Gemini, OpenAI, local models). NEVER run Claudish directly in main context unless user explicitly requests it. Use when user mentions external AI models, Claudish, OpenRouter, Gemini, OpenAI, Ollama, or alternative models. Includes mandatory sub-agent delegation patterns, agent selection guide, file-based instructions, and strict rules to prevent context window pollution.

413

schemas

MadAppGang

YAML frontmatter schemas for Claude Code agents and commands. Use when creating or validating agent/command files.

23

golang

MadAppGang

Use when building Go backend services, implementing goroutines/channels, handling errors idiomatically, writing tests with testify, or following Go best practices for APIs/CLI tools.

102

golang-performance

MadAppGang

Use when profiling Go applications (pprof), running benchmarks, optimizing memory/CPU usage, or debugging performance bottlenecks in production Go code.

52

external-model-selection

MadAppGang

Choose optimal external AI models for code analysis, bug investigation, and architectural decisions. Use when consulting multiple LLMs via claudish, comparing model perspectives, or investigating complex Go/LSP/transpiler issues. Provides empirically validated model rankings (91/100 for MiniMax M2, 83/100 for Grok Code Fast) and proven consultation strategies based on real-world testing.

172

hierarchical-coordinator

MadAppGang

Prevent goal drift in long-running multi-agent workflows using a coordinator agent that validates outputs against original objectives at checkpoints. Use when orchestrating 3+ agents, multi-phase features, complex implementations, or any workflow where agents may lose sight of original requirements. Trigger keywords - "hierarchical", "coordinator", "anti-drift", "checkpoint", "validation", "goal-alignment", "decomposition", "phase-gate", "shared-state", "drift detection".

21

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.

1,6851,428

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."

1,2661,332

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.

1,5361,147

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.

1,356809

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.

1,264728

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,489684