google-gemini-api

Integrate Google's Gemini API with the genai SDK for Node.js and browser environments.

1|2|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/Danejw/viewbait --skill google-gemini-api-danejw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-gemini-api
Source: https://github.com/Danejw/viewbait/tree/main/.cursor/skills/google-gemini-api
Command: npx skills add https://github.com/Danejw/viewbait --skill google-gemini-api-danejw

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables developers to integrate Google's Gemini API with the @google/genai SDK, unlocking advanced capabilities such as text generation, multimodal inputs (images, video, audio, PDFs), function calling, streaming, and thinking mode, while avoiding deprecated SDKs and common migration pitfalls.

Core Features & Use Cases

  • Gemini API integration with the GenAI SDK for Node.js/TypeScript environments.
  • Multimodal inputs, function calling, streaming, and thinking mode to support end-to-end workflows.
  • Clear guidance for production readiness, including error handling, token usage, and SDK migration.

Quick Start

Install the official SDK, set GEMINI_API_KEY, initialize GoogleGenAI, and run a basic generateContent request using gemini-2.5-flash to verify integration. Then explore advanced features like streaming and function calling via simple prompts to see live results.

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 Google Gemini API using the GenAI SDK in Node.js?

You can integrate the Google Gemini API by installing the official @google/genai SDK, configuring the GEMINI_API_KEY environment variable, initializing GoogleGenAI, and executing a basic generateContent request using gemini-2.5-flash to verify multimodal AI capabilities.

Can I process multimodal inputs like images, video, and PDFs with the Gemini API?

Yes, the Gemini API supports multimodal inputs including images, video, audio, and PDFs. Using the @google/genai SDK, you can pass these diverse file formats directly into your generateContent requests to analyze and generate text from multiple media types.

What's the best way to migrate from deprecated Gemini SDKs to the current GenAI SDK?

The best way to migrate from deprecated Gemini SDKs to the current @google/genai SDK is to enforce explicit model versioning for caching and follow safe migration guidance. This approach clarifies setup requirements and helps you avoid common migration pitfalls during production deployments.

Does the Gemini API support streaming and function calling in browser environments?

Yes, the Gemini API supports both streaming and function calling across Node.js and browser environments. The @google/genai SDK enables these advanced features to support end-to-end workflows, allowing real-time text generation and tool integration directly in the browser.

How do I handle token usage and errors when generating content with the Gemini API?

To handle token usage and errors when generating content with the Gemini API, apply the production readiness guidance provided by the @google/genai SDK. This includes implementing proper error handling routines and monitoring token considerations to ensure stable application performance.