google-gemini-api
Integrate Gemini API with @google/genai SDK (NOT deprecated @google/generative-ai). Text generation, multimodal (images/video/audio/PDFs), function calling, thinking mode, streaming. 1M input tokens. Prevents 14 documented errors. Use when: Gemini integration, multimodal AI, reasoning with thinking mode. Troubleshoot: SDK deprecation, model not found, context window, function calling errors, streaming corruption, safety settings, rate limits.
npx skills add majiayu000/claude-skill-registry --skill google-gemini-api-brendadeeznuts1111-tier-1380-omega --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Instructs the agent to integrate the Gemini API using the current @google/genai SDK (not the deprecated @google/generative-ai), enabling text generation, multimodal inputs (images, video, audio, PDFs), function calling, thinking mode, and streaming. It also notes a 1M input token context and guidance to prevent 14 documented errors, with use cases centered on Gemini integration, multimodal AI, and thinking mode for reasoning enhancements.
How it works
The guide provides a complete end-to-end usage pattern including:
- Installation instructions for the correct SDK version (npm install @google/genai@1.34.0) and a fallback warning against the deprecated SDK.
- Environment setup for GEMINI_API_KEY.
- Code samples for both Node.js SDK and fetch-based approaches for:
- Basic Text Generation (generateContent) and streaming (generateContentStream) workflows.
- Streaming via SSE with explicit guidance on endpoint, request structure, and client-side parsing.
- Multimodal inputs across images, video, audio, and PDFs using inlineData with base64-encoded media and MIME types.
- Function calling (tool integration) with function declarations and call flows.
- Details on current Gemini models, including 2.5 series (1,048,576 token context, 65,536 output tokens) and 3.x series capabilities like thinking mode, streaming, and function calling.
- Notes on avoiding common mistakes (e.g., token context windows) and distinctions between SDK and fetch approaches.
- Example payloads for quick-starts, streaming, and multimodal content processing.
When to use it
Use when you need Gemini integration, multimodal AI capabilities, and thinking mode for reasoning tasks. Use when troubleshooting SDK deprecation, model discovery, context window concerns, function calling errors, streaming integrity, safety settings, or rate limits.
What it can touch
The skill declares and demonstrates usage with:
- Node.js SDK:
@google/genai(Example imports:import { GoogleGenAI } from '@google/genai') - Fetch-based REST calls (endpoints like
https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContentand:streamGenerateContent) - Media content handling via inlineData with
mimeTypeand base64-encoded payloads (images, video, audio, PDFs) - Function calling declarations and usage (e.g.,
get_current_weatheras a tool)
Caveats
- License: MIT (as declared in the skill metadata)
- It emphasizes using the non-deprecated SDK (
@google/genai), with a migration note from@google/generative-aiand a warning about deprecated code in practice. - The guide contains model-specific context limits and feature availability per model (e.g., Gemini 2.5 vs Gemini 3.x), and it warns about preview models and SLAs.
- It explicitly documents known issues and error-handling sections, including rate limits and safety configurations.
# Google Gemini API - Complete Guide **Version**: 3.0.0 (14 Known Issues Added) **Package**: @google/genai@1.35.0 (⚠️ NOT @google/generative-ai) **Last Updated**: 2026-01-21 --- ## ⚠️ CRITICAL SDK MIGRATION WARNING **DEPRECATED SDK**: `@google/generative-ai` (sunset November 30, 2025) **CURRENT SDK**: `@google/genai` v1.27+ **If you see code using `@google/generative-ai`, it's outdated!** This skill uses the **correct current SDK** and provides a complete migration guide. --- ## Status **✅ Phase 1 Complete**: - ✅ Text Generation (basic + streaming) - ✅ Multimodal Inputs (images, video, audio, PDFs) - ✅ Function Calling (basic + parallel execution) - ✅ System Instructions & Multi-turn Chat - ✅ Thinking Mode Configuration - ✅ Generation Parameters (temperature, top-p, top-k, stop sequences) - ✅ Both Node.js SDK (@google/genai) and fetch approaches **✅ Phase 2 Complete**: - ✅ Context Caching (cost optimization with TTL-based caching) - ✅ Code Execution (built-in Python interpreter and sandbox) - ✅ Grounding with Google Search (real-time web information + citations) **📦 Separate Skills**: - **Embeddings**: See `google-gemini-embeddings` skill for text-embedding-004 --- ## Table of Con
- ⚠️ CRITICAL SDK MIGRATION WARNING
- Status
- Table of Contents
- Quick Start
- Installation
- Environment Setup
- First Text Generation (Node.js SDK)
- First Text Generation (Fetch - Cloudflare Workers)
- Current Models (2025)
- Gemini 3 Series (December 2025)
- Gemini 2.5 Series (General Availability - Stable)
- Model Feature Matrix
- ⚠️ Context Window Correction
- SDK vs Fetch Approaches
npm install @google/genai@1.34.0 npm install @google/generative-ai # DO NOT USE! export GEMINI_API_KEY="..."
What does the google-gemini-api skill do?
Integrate Gemini API with @google/genai SDK (NOT deprecated @google/generative-ai). Text generation, multimodal (images/video/audio/PDFs), function calling, thinking mode, streaming. 1M input tokens. Prevents 14 documented errors. Use when: Gemini integration, multimodal AI, reasoning with thinking mode. Troubleshoot: SDK deprecation, model not found, context window, function calling errors, streaming corruption, safety settings, rate limits.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill google-gemini-api-brendadeeznuts1111-tier-1380-omega --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
