hybridlabor-api/bdb-dev-optimized-antigravity-skills/gemini-api-integration
Claude Code and agent skill by hybridlabor-api/bdb-dev-optimized-antigravity-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when integrating Google Gemini API into projects. Covers model selection, multimodal inputs, streaming, function calling, and production best practices.
Install
npx vskill@latest install hybridlabor-api/bdb-dev-optimized-antigravity-skills/gemini-api-integrationSKILL.md
The same SKILL.md was published earlier as tmolavi/mcp-agent-skills-hub/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:
Python:
Set your API key securely:
2. Basic Text Generation
Node.js:
Python:
3. Streaming Responses
4. Multimodal Input (Text + Image)
5. Function Calling / Tool Use
6. Multi-turn Chat
7. Model Selection Guide
| Model | Best For | Speed | Cost | |
|---|---|---|---|---|
gemini-1.5-flash | High-throughput, cost-sensitive tasks | Fast | Low | |
gemini-1.5-pro | Complex reasoning, long context | Medium | Medium | |
gemini-2.0-flash | Latest fast model, multimodal | Very Fast | Low | |
gemini-2.0-pro | Most capable, advanced tasks | Slow | High |
Best Practices
- ✅ Do: Use
gemini-1.5-flashfor most tasks — it's fast and cost-effective - ✅ Do: Always stream responses for user-facing chat UIs to reduce perceived latency
- ✅ Do: Store API keys in environment variables, never hard-code them
- ✅ Do: Implement exponential backoff for rate limit (429) errors
- ✅ Do: Use
systemInstructionto set persistent model behavior - ❌ Don't: Use
gemini-profor simple tasks — Flash is cheaper and faster - ❌ Don't: Send large base64 images inline for files > 20MB — use File API instead
- ❌ Don't: Ignore safety ratings in responses for production apps
Error Handling
Troubleshooting
Problem: API_KEY_INVALID error Solution: Ensure GEMINI_API_KEY environment variable is set and the key is active in Google AI Studio.
Problem: Response blocked by safety filters Solution: Check result.response.promptFeedback.blockReason and adjust your prompt or safety settings.
Problem: Slow response times Solution: Switch to gemini-1.5-flash and enable streaming. Consider caching repeated prompts.
Problem: RESOURCE_EXHAUSTED (quota exceeded) Solution: Check your quota in Google Cloud Console. Implement request queuing and exponential backoff.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/global_config/gemini-api-integration/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hybridlabor-api/bdb-dev-optimized-antigravity-skills/gemini-api-integration)