gemini-api

Implements Gemini API integrations on Agent Platform using the Google Gen AI SDK.

Updated Dec 9, 2025
One-click install
npx skills add https://github.com/Aki2022/skills --skill gemini-api-aki2022
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gemini-api
Source: https://github.com/Aki2022/skills/tree/main/gemini-api
Command: npx skills add https://github.com/Aki2022/skills --skill gemini-api-aki2022

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-genai, @google/genai, google.golang.org/genai, Google.GenAI, and includes references (resource) components.

What problem does it solve? Integrating Google's Gemini models in enterprise environments requires navigating SDK choices, authentication methods, model selection, and a wide range of API capabilities, which is error-prone without up-to-date guidance. ## Core Features & Use Cases - Unified SDK Guidance: Enforces the Google Gen AI SDK (google-genai) across Python, JS/TS, Go, Java, and C#, while steering away from deprecated legacy SDKs. - Full Capability Coverage: Provides reference implementations for text generation, multimodal inputs, function calling, structured output, embeddings, Live API streaming, image/video generation, caching, batch prediction, and model tuning. - Use Case: A developer needs to build a Python service that summarizes PDF documents stored in Google Cloud Storage using Gemini on Agent Platform; this Skill supplies the correct SDK, authentication setup, model choice, and working code patterns. ## Quick Start Ask the assistant to write a Python script using the Gemini API on Agent Platform that generates text with the google-genai SDK.

Frequently Asked Questions about gemini-api

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

FAQPage Schema
How do I use the Gemini API with Vertex AI in Python?

Install the google-genai package with pip, set GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION, and GOOGLE_GENAI_USE_VERTEXAI=true environment variables, then create a client with genai.Client() and call client.models.generate_content with a Gemini 3 model.

What is the difference between google-genai and google-cloud-aiplatform?

google-genai is the current unified Gen AI SDK for the Gemini API on Agent Platform, while google-cloud-aiplatform, @google-cloud/vertexai, and google-generativeai are deprecated legacy SDKs. New development should use google-genai and migrate existing code away from the legacy packages.

Which Gemini model should I use for my task?

Use gemini-3.1-pro-preview for complex reasoning and coding, gemini-3-flash-preview for fast balanced multimodal tasks, and gemini-3.1-flash-lite-preview for high-frequency lightweight workloads. Gemini 2.0, 1.5, and 1.0 models are deprecated.

Can I use the Gemini API with an API key instead of Google Cloud credentials?

Yes, Agent Platform Express Mode supports API key authentication. Set GOOGLE_API_KEY and GOOGLE_GENAI_USE_VERTEXAI=true environment variables, then initialize the client without arguments to pick them up automatically.

How do I generate images or videos with the Gemini API?

Use gemini-3.1-flash-image-preview or gemini-3-pro-image-preview for image generation and editing via generate_content, and use the Veo model (veo-3.1-fast-generate-001) with client.models.generate_videos for asynchronous video generation.

Does the Gemini API support real-time voice streaming?

Yes, the Live API provides bidirectional WebSocket streaming for low-latency voice and video interactions using the gemini-live-2.5-flash-native-audio model. Connect via client.aio.live.connect and send audio with session.send_realtime_input.