Claude-skill-registry gemini-api-full

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/gemini-api-full" ~/.claude/skills/majiayu000-claude-skill-registry-gemini-api-full && rm -rf "$T"
manifest: skills/data/gemini-api-full/SKILL.md
source content

Gemini API Skill

Build AI applications with Google's Gemini models and tools.

Quick Start

Installation

# Python
pip install google-genai

# JavaScript/Node.js
npm install @google/genai

# Go
go get google.golang.org/genai

Environment Setup

export GEMINI_API_KEY="your-api-key"

Basic Usage

Python:

from google import genai

client = genai.Client()
response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="Your prompt here"
)
print(response.text)

JavaScript:

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});
const response = await ai.models.generateContent({
    model: "gemini-2.5-flash",
    contents: "Your prompt here"
});
console.log(response.text);

REST:

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"contents": [{"parts": [{"text": "Your prompt here"}]}]}'

Model Selection

ModelBest ForContext Window
Gemini 3 ProMost intelligent tasks, multimodal reasoning, agenticSee models-overview
Gemini 2.5 ProComplex reasoning, coding, extended thinking1M tokens
Gemini 2.5 FlashBalanced performance, general tasks1M tokens
Gemini 2.5 Flash-LiteHigh-volume, cost-sensitive, fastestSee models-overview
ImagenHigh-fidelity image generationN/A
Veo 3.1Video generation (8s, 720p/1080p with audio)N/A
Nano BananaNative image gen with Gemini 2.5 FlashN/A
Nano Banana ProNative image gen with Gemini 3 ProN/A

Reference Documentation Index

Getting Started

TopicFileDescription
Setup & Librariesgetting-started.mdAPI keys, SDK installation, OpenAI compatibility

Models & Pricing

TopicFileDescription
Model Overviewmodels-overview.mdAll models, capabilities, context windows
Pricingapi-pricing.mdToken costs, tool pricing
Rate Limitsrate-limits.mdRPM/TPM limits, quotas
Gemini 3 Guidegemini-3.mdGemini 3 specific features and best practices
Imagenimagen.mdImage generation with Imagen model
Embeddingsembeddings.mdText embeddings for search/RAG
Veoveo.mdVideo generation with Veo 3.1 (69K)
Lyrialyria.mdMusic generation with Lyria RealTime
Roboticsrobotics.mdGemini Robotics-ER 1.5 (42K)

Core Capabilities

TopicFileDescription
Text Generationtext-generation.mdText generation, system instructions (38K)
Image Gen (Nano Banana)image-generation-gemini.mdNative image generation with Gemini (LARGE: 174K)
Image Understandingimage-understanding.mdVision, image analysis
Video Understandingvideo-understanding.mdVideo analysis, timestamps
Document Understandingdocument-understanding.mdPDF and document processing
Speech Generationspeech-generation.mdText-to-speech (TTS)
Audio Understandingaudio-understanding.mdAudio analysis, transcription

Advanced Features

TopicFileDescription
Thinking Modethinking.mdExtended reasoning capabilities
Thought Signaturesthought-signatures.mdEDGE CASE ONLY: Manual signature handling when NOT using official SDKs
Structured Outputsstructured-outputs.mdJSON schema responses
Function Callingfunction-calling.mdCustom tool integration (54K)
Long Contextlong-context.md1M+ token handling, context caching

Tools

TopicFileDescription
Tools Overviewtools-overview.mdBuilt-in tools summary, agent frameworks
Google Searchgoogle-search.mdWeb search grounding
Google Mapsgoogle-maps.mdLocation-aware grounding
Code Executioncode-execution.mdPython code execution tool
URL Contexturl-context.mdURL content extraction
Computer Usecomputer-use.mdBrowser automation (preview) (44K)
File Searchfile-search.mdRAG with document indexing

Live API (Real-time Streaming)

TopicFileDescription
Getting Startedlive-api-getting-started.mdLow-latency voice/video interactions
Capabilities Guidelive-api-capabilities.mdFull capabilities and configurations (32K)
Tool Uselive-api-tools.mdFunction calling & Search in Live API
Session Managementlive-api-sessions.mdSession handling, time limits
Ephemeral Tokensephemeral-tokens.mdShort-lived auth for client-side WebSockets

Guides

TopicFileDescription
Batch APIbatch-api.mdAsync processing at 50% cost (47K)
Files APIfiles-api.mdUpload and manage media files (49K)
Context Cachingcontext-caching.mdImplicit & explicit caching for cost savings
Media Resolutionmedia-resolution.mdControl token allocation for media
Tokenstokens.mdUnderstand and count tokens
Prompt Designprompt-design.mdPrompt strategies and best practices (47K)
Logs & Datasetslogs-datasets.mdEnable logging, view in AI Studio
Data Logging & Sharingdata-logging-sharing.mdStorage and management of API logs
Safety Settingssafety-settings.mdAdjust safety filters
Safety Guidancesafety-guidance.mdBest practices for safe AI use

Troubleshooting & Migration

TopicFileDescription
Troubleshootingtroubleshooting.mdDiagnose and resolve common API issues (25K)
Vertex AI Comparisonvertex-ai-comparison.mdREAD ONLY IF USER MENTIONS "VERTEX AI": Gemini Developer API vs Vertex AI differences

API Reference (Technical Endpoints)

Note: These are technical endpoint specifications with schemas and parameter details. For usage guides and code examples, see the guide files above.

TopicFileDescription
Overviewapi-reference-overview.mdREST/streaming/realtime API overview (33K)
Models Endpointapi-models-reference.mdmodels.get, models.list, models.predict
Generate Contentapi-generate-content.mdgenerateContent + all response types (LARGE: 166K)
Live API WebSocketsapi-live-websockets.mdWebSockets API for Live API (48K)
Live Music WebSocketsapi-live-music-websockets.mdWebSockets API for Lyria RealTime
Files Endpointapi-files-reference.mdUpload/manage media files (40K)
Batch Endpointapi-batch-reference.mdBatch processing endpoints (40K)
Caching Endpointapi-caching-reference.mdContext caching endpoints (LARGE: 89K)
Embeddings Endpointapi-embeddings-reference.mdEmbeddings generation endpoints (30K)
File Search Storesapi-file-search-reference.mdFile Search + Documents endpoints (35K)

Large Files - Search Patterns

For large reference files (>30K), use grep to find specific sections:

image-generation-gemini.md (174K):

grep -n "## " references/image-generation-gemini.md  # List sections
grep -n "edit" references/image-generation-gemini.md  # Find editing info
grep -n "style" references/image-generation-gemini.md  # Find style transfer

api-generate-content.md (166K):

grep -n "## " references/api-generate-content.md  # List sections
grep -n "GenerationConfig" references/api-generate-content.md  # Config options
grep -n "SafetySetting" references/api-generate-content.md  # Safety types

api-caching-reference.md (89K):

grep -n "## " references/api-caching-reference.md  # List sections
grep -n "CachedContent" references/api-caching-reference.md  # Cache types

veo.md (69K):

grep -n "## " references/veo.md  # List sections
grep -n "audio" references/veo.md  # Find audio generation info

models-overview.md (67K):

grep -n "gemini-3" references/models-overview.md
grep -n "context" references/models-overview.md

function-calling.md (54K):

grep -n "## " references/function-calling.md
grep -n "parallel" references/function-calling.md  # Parallel function calls

Common Patterns

Multimodal Input (Image + Text)

from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents=[
        types.Part.from_image(image_path),
        types.Part.from_text("Describe this image")
    ]
)

Function Calling

tools = [
    types.Tool(function_declarations=[{
        "name": "get_weather",
        "description": "Get weather for a location",
        "parameters": {
            "type": "object",
            "properties": {"location": {"type": "string"}},
            "required": ["location"]
        }
    }])
]

response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="What's the weather in Paris?",
    config=types.GenerateContentConfig(tools=tools)
)

Google Search Grounding

response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="What are the latest AI developments?",
    config=types.GenerateContentConfig(
        tools=[types.Tool(google_search=types.GoogleSearch())]
    )
)

Thinking Mode

response = client.models.generate_content(
    model="gemini-2.5-pro",
    contents="Solve this complex problem...",
    config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(thinking_budget_tokens=10000)
    )
)

Streaming

for chunk in client.models.generate_content_stream(
    model="gemini-2.5-flash",
    contents="Write a story"
):
    print(chunk.text, end="")

Key Concepts

Tool Execution Flow

Built-in tools (Google Search, Code Execution): Executed by Google

  1. Send prompt with tool config → Model executes tool → Response with grounded results

Custom tools (Function Calling): You execute

  1. Send prompt with function declarations → Model returns function call JSON
  2. You execute function, send result back → Model generates final response

Thought Signatures (Important)

  • If using official SDKs with chat feature: Thought signatures are handled automatically. No action needed.
  • If manually managing conversation history: Read thought-signatures.md for Gemini 3 Pro function calling requirements.

API Endpoints

EndpointPurpose
/v1beta/models/{model}:generateContent
Standard generation
/v1beta/models/{model}:streamGenerateContent
Streaming
/v1beta/models/{model}:embedContent
Embeddings
/v1beta/models/{model}:countTokens
Token counting

Base URL:

https://generativelanguage.googleapis.com