Guide for implementing Google Gemini API image understanding - analyze images with captioning, classification, visual QA, object detection, segmentation, and multi-image comparison. Use when analyzing images, answering visual questions, detecting objects, or processing documents with vision.
Google Gemini API skill for advanced image understanding tasks.
pip install google-genaiexport GEMINI_API_KEY="your-api-key"
gemini-vision/
├── SKILL.md # Main skill file (auto-loaded by Claude)
├── README.md # This file
├── scripts/ # Helper scripts
│ ├── analyze-image.py # Main analysis script
│ ├── upload-file.py # File upload helper
│ └── manage-files.py # File management (list/get/delete)
└── references/ # Detailed documentation
├── api-reference.md # API methods and endpoints
├── examples.md # Code examples
└── best-practices.md # Advanced tips and optimization
# In Claude Code CLI
/gemini-vision
Once loaded, Claude will have access to all Gemini Vision capabilities.
# Analyze single image
python scripts/analyze-image.py image.jpg "What's in this image?"
# Multiple images
python scripts/analyze-image.py img1.jpg img2.jpg "What's different?"
# Upload file
python scripts/upload-file.py large_image.jpg
# Manage files
python scripts/manage-files.py list
python scripts/manage-files.py get files/abc123
python scripts/manage-files.py delete files/abc123
The skill checks for GEMINI_API_KEY in this order:
Process environment (recommended)
export GEMINI_API_KEY="your-key"
Skill directory: .claude/skills/gemini-vision/.env
GEMINI_API_KEY=your-api-key
Project root: .env or .gemini_api_key
from google import genai
from google.genai import types
client = genai.Client(api_key="YOUR_API_KEY")
with open('image.jpg', 'rb') as f:
response = client.models.generate_content(
model='gemini-2.5-flash',
contents=[
types.Part.from_bytes(f.read(), mime_type='image/jpeg'),
'Describe this image'
]
)
print(response.text)
import { GoogleGenAI } from "@google/genai";
import fs from "node:fs";
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const image = fs.readFileSync("image.jpg", { encoding: "base64" });
const response = await ai.models.generate({
model: "gemini-2.5-flash",
contents: [{
parts: [
{ inline_data: { mime_type: "image/jpeg", data: image } },
{ text: "What's in this image?" }
]
}]
});
console.log(response.text);
MIT
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer