google-gemini-api

Integrate the Google Gemini API with the @google/genai SDK for generation, multimodal processing, and function calling.

52|6|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ovachiever/droid-tings --skill google-gemini-api-ovachiever
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-gemini-api
Source: https://github.com/ovachiever/droid-tings/tree/main/skills/google-gemini-api
Command: npx skills add https://github.com/ovachiever/droid-tings --skill google-gemini-api-ovachiever

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @google/genai, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Integrates Google Gemini API using the correct current SDK (@google/genai v1.27+), enabling robust text generation, multimodal inputs, function calling, streaming, and advanced features while avoiding deprecated SDK pitfalls.

Core Features & Use Cases

  • Text generation, streaming, and multimodal inputs across Gemini 2.5/3 series
  • Function calling and parallel execution with real-time grounding and code execution (Phase 2)
  • Migrations from @google/generative-ai and edge deployments (Cloudflare Workers)
  • Context caching and integrated Google Search grounding (Phase 2)
  • Production-ready Node.js SDK and fetch-based approaches

Quick Start

Create a Gemini client with @google/[email protected] and run a simple generateContent request against gemini-2.5-flash to illustrate capabilities, then expand to multimodal and grounding features.

Frequently Asked Questions about google-gemini-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate the Gemini API for text generation and multimodal inputs?

Use the @google/genai SDK (v1.27+) to create a Gemini client and call generateContent with text or multimodal inputs. The SDK handles authentication, streaming, and model routing across Gemini 2.5/3 series models like gemini-2.5-flash and gemini-2.5-pro for production text generation and processing.

Can I use Gemini API function calling for real-time tool execution?

Yes, function calling in @google/genai supports parallel tool execution and real-time grounding with Google Search and code execution in Phase 2. Define tool schemas, pass them to generateContent, and handle tool responses to build dynamic chat workflows and autonomous agents.

Does Gemini API work in edge environments like Cloudflare Workers?

Yes, the @google/genai SDK supports both Node.js and fetch-based implementations, enabling Gemini API deployment on edge platforms like Cloudflare Workers. Use fetch endpoints for edge compatibility while maintaining streaming, multimodal, and function-calling capabilities.

What's the difference between the current @google/genai SDK and the deprecated @google/generative-ai?

The current @google/genai (v1.27+) is the supported SDK for Gemini API access. The older @google/generative-ai is deprecated; migrate to @google/genai to access Phase 2 features like function calling, grounding, and context caching with explicit model version suffixes.

How do I set up context caching and semantic caching for long-context reasoning?

Context caching in @google/genai requires explicit model version suffixes and cache configuration in generateContent requests. Cache long contexts to reduce latency and cost for repeated queries, enabling efficient long-context reasoning and Phase 2 advanced reasoning modes.

Why do I need explicit model version suffixes when using Gemini API?

Explicit model version suffixes (e.g., gemini-2.5-flash) are required by @google/genai for caches, resources, and consistent behavior across SDK versions. Suffixes ensure correct model selection, enable versioning, and allow proper allocation of advanced features like thinking mode and function calling.