| name | gemini-api-integration |
| description | Use when integrating Google Gemini API into projects. Covers model selection, multimodal inputs, streaming, function calling, and production best practices. |
| type | skill |
| created | 2026-02-27T00:00:00.000Z |
| domain | ai-ml |
| category | llm-agents |
| risk | safe |
| source | community |
| tags | ["skill","ai-ml","llm-agents","gemini","api","integration"] |
Gemini API Integration
Overview
This skill guides AI agents through integrating Google Gemini API into applications — from basic text generation to advanced multimodal, function calling, and streaming use cases. It covers the full Gemini SDK lifecycle with production-grade patterns.
When to Use This Skill
- Use when setting up Gemini API for the first time in a Node.js, Python, or browser project
- Use when implementing multimodal inputs (text + image/audio/video)
- Use when adding streaming responses to improve perceived latency
- Use when implementing function calling / tool use with Gemini
- Use when optimizing model selection (Flash vs Pro vs Ultra) for cost and performance
- Use when debugging Gemini API errors, rate limits, or quota issues
Step-by-Step Guide
1. Installation & Setup
Node.js / TypeScript:
npm install @google/generative-ai
Python:
pip install google-generativeai
Set your API key securely:
export GEMINI_API_KEY="your-api-key-here"
2. Basic Text Generation
Node.js:
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });
const result = await model.generateContent("Explain async/await in JavaScript");
console.log(result.response.text());
Python: