Agent skill · Backend & API

google-gemini-api

Complete guide for Google Gemini API using the CORRECT current SDK (@google/genai v1.27+, NOT the deprecated @google/generative-ai). Covers text generation, multimodal inputs (text + images + video + audio + PDFs), function calling, thinking mode, streaming, and system instructions with accurate 2025 model information (Gemini 2.5 Pro/Flash/Flash-Lite with 1M input tokens, NOT 2M). Use when: integrating Gemini API, implementing multimodal AI applications, using thinking mode for complex reasoning, function calling with parallel execution, streaming responses, deploying to Cloudflare Workers, bu

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill google-gemini-api --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 52 KB
Bundled scripts: none
Path: skills/ai-llm/google-gemini-api/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

The skill provides a comprehensive guide for using Google Gemini API with the correct current SDK (@google/genai v1.27+). It covers text generation (including streaming), multimodal inputs (images, video, audio, PDFs), function calling (including parallel execution), thinking mode, system instructions, and multi-turn chat. It documents current Gemini 2.5 models (Pro, Flash, Flash-Lite) with their context windows and features, and includes a migration emphasis away from the deprecated SDK. It also outlines how to run both Node.js SDK and fetch-based approaches, and demonstrates setup for Cloudflare Workers, as well as hosting considerations and common pitfalls like context window errors. Commands and code samples use the exact endpoints and method names described in the guidance, and it specifies required API keys and model endpoints for generation and streaming.

How it works

  • Installation and environment setup require the CORRECT SDK: npm install @google/genai@1.27.0 and exporting GEMINI_API_KEY.
  • Basic text generation is shown both with the Node.js SDK (import { GoogleGenAI } from '@google/genai') and with fetch, using model: 'gemini-2.5-flash' and the appropriate generateContent endpoint; streaming is demonstrated via generateContentStream (SDK) and streamGenerateContent (fetch).
  • Multimodal inputs include images, video, audio, and PDFs, each supported via contents with parts including inlineData (base64) and mimeType; specific formats and size limits are enumerated (e.g., images up to 20MB, videos up to 2 minutes inline, PDFs up to 30MB).
  • Function calling is supported with a sample function declaration (name, description, parametersJsonSchema) and a request configuring tools to enable function execution; it shows how to capture the functionCall and then return results to the model.
  • Thinking mode is highlighted as the default-on feature across Gemini-2.5 variants, with parallel and compositional function calling supported.
  • The guide distinguishes Node.js SDK benefits and fetch-based approaches for environments like Cloudflare Workers, browsers, and edge runtimes, including tradeoffs like SSE parsing and error handling.
  • Phase 1 and Phase 2 features are listed (e.g., context caching, code execution, grounding with Google Search) and the context window size is clarified as 1,048,576 tokens for Gemini 2.5 models, not 2M.
  • It includes model-specific capabilities (Pro, Flash, Flash-Lite) and confirms their shared features (thinking mode, function calling, multimodal, streaming, system instructions) and token limits.

When to use it

Use when integrating Gemini API, implementing multimodal AI applications, using thinking mode for complex reasoning, function calling with parallel execution, streaming responses, deploying to Cloudflare Workers, building chat applications, or encountering SDK deprecation warnings, context window errors, model not found errors, function calling failures, or multimodal format errors.

What it can touch

  • Tools: Function calling with declared tools (example includes a get_current_weather function). The skill demonstrates using tools via the SDK by attaching functionDeclarations and then handling the functionCall in the response.

Caveats

  • License: MIT
  • It repeatedly cautions to use the correct current SDK (@google/genai) and warns against deprecated @google/generative-ai; migration guidance is included.
  • It specifies precise context window and token limits for Gemini 2.5 models (1,048,576 input tokens; 65,536 output tokens) and notes that 2M-token context is incorrect for these models.
  • It notes that PDFs and multimodal inputs have size limits and format requirements (image, video, audio, PDF).
From the SKILL.md

# Google Gemini API - Complete Guide **Version**: Phase 2 Complete ✅ **Package**: @google/genai@1.27.0 (⚠️ NOT @google/generative-ai) **Last Updated**: 2025-10-25 --- ## ⚠️ 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 Contents **Pha

What's inside
Steps it walks through
  1. ⚠️ CRITICAL SDK MIGRATION WARNING
  2. Status
  3. Table of Contents
  4. Quick Start
  5. Installation
  6. Environment Setup
  7. First Text Generation (Node.js SDK)
  8. First Text Generation (Fetch - Cloudflare Workers)
  9. Current Models (2025)
  10. Gemini 2.5 Series (General Availability)
  11. Model Feature Matrix
  12. ⚠️ Context Window Correction
  13. SDK vs Fetch Approaches
  14. Node.js SDK (@google/genai)
Ships with 1 file
  • metadata.json
Commands it runs
npm install @google/genai@1.27.0
npm install @google/generative-ai  # DO NOT USE!
export GEMINI_API_KEY="..."
Remove deprecated SDK
npm uninstall @google/generative-ai
Install current SDK
More from claude-skill-registry
All skills →
About this skill
What does the google-gemini-api skill do?

Complete guide for Google Gemini API using the CORRECT current SDK (@google/genai v1.27+, NOT the deprecated @google/generative-ai). Covers text generation, multimodal inputs (text + images + video + audio + PDFs), function calling, thinking mode, streaming, and system instructions with accurate 2025 model information (Gemini 2.5 Pro/Flash/Flash-Lite with 1M input tokens, NOT 2M). Use when: integrating Gemini API, implementing multimodal AI applications, using thinking mode for complex reasoning, function calling with parallel execution, streaming responses, deploying to Cloudflare Workers, bu

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill google-gemini-api --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.

Keep going