google-genai
Use when integrating Google Gemini models via the @google/genai SDK — text generation, chat, multimodal (vision, audio, video), function calling, embeddings, safety settings, streaming, or context caching. Also use when choosing between Gemini models or migrating from the older @google/generative-ai SDK.
| Model | Source |
|---|---|
| sonnet | pack: ai |
Full Reference
┏━ 🔧 google-genai ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when integrating Google Gemini models via … ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Google Generative AI (Gemini)
Section titled “Google Generative AI (Gemini)”Direct Gemini API access via the @google/genai SDK (GA as of May 2025). Supports both Gemini Developer API and Vertex AI.
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Install | npm install @google/genai |
| SDK version | v1.x |
| Node.js minimum | 20+ |
| Env var (Developer API) | GEMINI_API_KEY |
| Default model | gemini-2.5-flash |
| Pro model | gemini-2.5-pro |
| Lite model | gemini-2.5-flash-lite |
| Embeddings model | text-embedding-004 |
| Context window | 1M tokens (all 2.5 models) |
| Legacy model retiring | gemini-2.0-flash — March 31, 2026 |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Install the SDK and initialize the client | reference/setup.md |
| Choose the right Gemini model | reference/models.md |
| Generate text, stream responses, or run multi-turn chat | reference/text-generation.md |
| Send images, audio, or video alongside text | reference/multimodal.md |
| Define functions and handle tool calls | reference/function-calling.md |
| Get schema-enforced JSON output | reference/structured-output.md |
| Create vector embeddings for RAG or search | reference/embeddings.md |
| Configure safety filters and handle blocked responses | reference/safety-settings.md |
| Cache large repeated context for cost and latency savings | reference/context-caching.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.
Related Skills
Section titled “Related Skills”vercel-ai-sdk— Multi-provider abstraction layer (wraps Gemini + others)anthropic-api— Claude alternative with similar capabilitiesopenai-api— GPT alternative, same skill categorypostgresql-pgvector— Store and query Gemini embeddings in Postgres