Agent skill

Gemini API Integration

by majiayu000 in majiayu000/claude-skill-registry

A skill your agent uses when integrating Google Gemini API into projects.

MITAuto-check passedAI & LLM Engineering

Install Gemini API Integration

skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill gemini-api-integration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/claude-skill-registry gemini-api-integration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ai-llm/gemini-api-integration .claude/skills/gemini-api-integration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gemini-api-integration
GitHub stars
666
Used in
3 other repos
Token cost
~1.4k tokens
SKILL.md length
338 words
Files
2
Skills in repo
1,273
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when integrating Google Gemini API into projects.

  • Works in 7 steps: Installation & Setup → Basic Text Generation → Streaming Responses → …
  • Integrating Google Gemini API into projects
  • SKILL.md covers Overview, When to Use This Skill, Step-by-Step Guide and Best Practices, plus 2 more sections
  • Calls npm and pip; needs GEMINI_API_KEY

What it does

Gemini API Integration is an agent skill from majiayu000/claude-skill-registry. Use when integrating Google Gemini API into projects. Covers model selection, multimodal inputs, streaming, function calling, and production best practices.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `metadata.json`).

It sits in AI & LLM Engineering, covering LLM API integration and Structured output and tool calling. It works with Google Gemini, Python and Node.js. The repository describes itself as: Searchable Claude Code skills catalog with source-linked guides and generated registry artifacts. The licence is MIT.

When your agent uses it

  • Integrating Google Gemini API into projects
  • Tasks that involve LLM API integration
  • Tasks that involve Structured output and tool calling

Example prompts

  • “/gemini-api-integration”

Requirements

  • Python 3
  • Node.js
  • A credential in GEMINI_API_KEY

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Installation & Setup
  2. Basic Text Generation
  3. Streaming Responses
  4. Multimodal Input (Text + Image)
  5. Function Calling / Tool Use
  6. Multi-turn Chat
  7. Model Selection Guide

What it can do on your machine

Read from SKILL.md and the folder at commit 2d14a69. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm and pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GEMINI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gemini API Integration loads about 1.4k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 338 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from majiayu000/claude-skill-registry at commit 2d14a69, republished under its MIT licence (© majiayu000). 338 words, ~1,432 tokens.

Download SKILL.mdSave it as .claude/skills/gemini-api-integration/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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.
risk
safe
source
community
date_added
2026-03-04

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:

bash
npm install @google/generative-ai

Python:

bash
pip install google-generativeai

Set your API key securely:

bash
export GEMINI_API_KEY="your-api-key-here"
2. Basic Text Generation

Node.js:

javascript
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:

python
import google.generativeai as genai
import os

genai.configure(api_key=os.environ["GEMINI_API_KEY"])
model = genai.GenerativeModel("gemini-1.5-flash")

response = model.generate_content("Explain async/await in JavaScript")
print(response.text)
3. Streaming Responses
javascript
const result = await model.generateContentStream("Write a detailed blog post about AI");

for await (const chunk of result.stream) {
  process.stdout.write(chunk.text());
}
4. Multimodal Input (Text + Image)
javascript
import fs from "fs";

const imageData = fs.readFileSync("screenshot.png");
const imagePart = {
  inlineData: {
    data: imageData.toString("base64"),
    mimeType: "image/png",
  },
};

const result = await model.generateContent(["Describe this image:", imagePart]);
console.log(result.response.text());
5. Function Calling / Tool Use
javascript
const tools = [{
  functionDeclarations: [{
    name: "get_weather",
    description: "Get current weather for a city",
    parameters: {
      type: "OBJECT",
      properties: {
        city: { type: "STRING", description: "City name" },
      },
      required: ["city"],
    },
  }],
}];

const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro", tools });
const result = await model.generateContent("What's the weather in Mumbai?");

const call = result.response.functionCalls()?.[0];
if (call) {
  // Execute the actual function
  const weatherData = await getWeather(call.args.city);
  // Send result back to model
}
6. Multi-turn Chat
javascript
const chat = model.startChat({
  history: [
    { role: "user", parts: [{ text: "You are a helpful coding assistant." }] },
    { role: "model", parts: [{ text: "Sure! I'm ready to help with code." }] },
  ],
});

const response = await chat.sendMessage("How do I reverse a string in Python?");
console.log(response.response.text());
7. Model Selection Guide
ModelBest ForSpeedCost
gemini-1.5-flashHigh-throughput, cost-sensitive tasksFastLow
gemini-1.5-proComplex reasoning, long contextMediumMedium
gemini-2.0-flashLatest fast model, multimodalVery FastLow
gemini-2.0-proMost capable, advanced tasksSlowHigh

Best Practices

  • ✅ Do: Use gemini-1.5-flash for 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 systemInstruction to set persistent model behavior
  • ❌ Don't: Use gemini-pro for 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

javascript
try {
  const result = await model.generateContent(prompt);
  return result.response.text();
} catch (error) {
  if (error.status === 429) {
    // Rate limited — wait and retry with exponential backoff
    await new Promise(r => setTimeout(r, 2 ** retryCount * 1000));
  } else if (error.status === 400) {
    // Invalid request — check prompt or parameters
    console.error("Invalid request:", error.message);
  } else {
    throw error;
  }
}

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.

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/ai-llm/gemini-api-integration of majiayu000/claude-skill-registry.

  • SKILL.md
  • metadata.json

Open the folder on GitHubat commit 2d14a69

Used in 3 other repositories

We found 12 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in majiayu000/claude-skill-registry, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Gemini API Integration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gemini API Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gemini API Integration this skillmajiayu000/claude-skill-registry6663 repos~1.4kAutomated safety check: PassMIT
Gemini API Devgoogle-gemini/gemini-skills4.3k—~5.1kAutomated safety check: PassApache-2.0
Gemini API DevAyuilos/Miffan1921 repos~1.4kAutomated safety check: PassAGPL-3.0
Gemini API Devaiskillstore/marketplace4303 repos~1.6kAutomated safety check: PassApache-2.0
Gemini API DevJetBrains/skills364—~1.6kAutomated safety check: PassNone
Gemini Interactions APIJetBrains/skills364—~2.5kAutomated safety check: PassNone

Similar skills

  • Gemini API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…

    4.3k GitHub stars~5.1k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Gemini API Dev

    Ayuilos/Miffan

    A skill your agent uses when building applications with Gemini API hosted models, including Gemini and Gemma 4, working with multimodal content (text, images, audio, video), implementing function…

    192 GitHub starsUsed in 1 repo~1.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Gemini API Dev

    aiskillstore/marketplace

    A skill your agent uses when building applications with Gemini API hosted models, including Gemini and Gemma 4, working with multimodal content (text, images, audio, video), implementing function…

    430 GitHub starsUsed in 3 repos~1.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Gemini API Dev

    JetBrains/skills

    Official

    A skill your agent uses when building applications with Gemini models, Gemini API, working with multimodal content (text, images, audio, video), implementing function calling, using structured…

    364 GitHub stars~1.6k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Gemini Interactions API

    JetBrains/skills

    Official

    A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, streaming responses, background research tasks…

    364 GitHub stars~2.5k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Gemini Live API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.

    4.3k GitHub stars~4.6k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from majiayu000/claude-skill-registry

All 1,273 skills in this repo
  • Deep Research

    majiayu000/claude-skill-registry

    Multi-source deep research using firecrawl and exa MCPs. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 6 repos~1.1k tokens
    Auto-check passed
  • Exa Search

    majiayu000/claude-skill-registry

    Neural search via Exa MCP for web, code, and company research.

    666 GitHub starsUsed in 5 repos~856 tokens
    Auto-check passed
  • Fal AI Media

    majiayu000/claude-skill-registry

    Unified media generation via fal.ai MCP — image, video, and audio.

    666 GitHub starsUsed in 5 repos~1.7k tokens
    Auto-check passed
  • Pyzotero

    majiayu000/claude-skill-registry

    Interact with Zotero reference management libraries using the pyzotero Python client.

    666 GitHub starsUsed in 5 repos~1.6k tokens
    Auto-check: notes
  • Bgpt Paper Search

    majiayu000/claude-skill-registry

    Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server.

    666 GitHub starsUsed in 4 repos~619 tokens
    Auto-check: notes
  • Bio Alignment Pairwise

    majiayu000/claude-skill-registry

    Perform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner.

    666 GitHub starsUsed in 4 repos~1.7k tokens
    Auto-check passed

Questions about Gemini API Integration

What does Gemini API Integration do?

A skill your agent uses when integrating Google Gemini API into projects. Gemini API Integration is an agent skill from majiayu000/claude-skill-registry. Use when integrating Google Gemini API into projects.

When should I use Gemini API Integration?

Gemini API Integration fits situations like: integrating Google Gemini API into projects; tasks that involve LLM API integration; tasks that involve Structured output and tool calling.

How do I install Gemini API Integration in Claude Code?

Run `npx skills add majiayu000/claude-skill-registry --skill gemini-api-integration -a claude-code`. Or copy the skill folder (skills/ai-llm/gemini-api-integration in majiayu000/claude-skill-registry) into .claude/skills/gemini-api-integration in your project. Claude Code loads it when a task matches its description.

How do I install Gemini API Integration in Codex?

Run `npx skills add majiayu000/claude-skill-registry --skill gemini-api-integration -a codex`. Or copy the skill folder (skills/ai-llm/gemini-api-integration in majiayu000/claude-skill-registry) into .agents/skills/gemini-api-integration in your project. Codex loads it when a task matches its description.

Can I use Gemini API Integration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/claude-skill-registry --skill gemini-api-integration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gemini-api-integration, .gemini/skills/gemini-api-integration, .github/skills/gemini-api-integration and .opencode/skills/gemini-api-integration in your project.

What does Gemini API Integration need to run?

Going by SKILL.md and its folder, Gemini API Integration needs the command-line tools its instructions call (npm and pip) and credentials named GEMINI_API_KEY. Our summary lists: Python 3; Node.js; A credential in GEMINI_API_KEY.

Does Gemini API Integration access the network?

SKILL.md contains no URLs. Its commands use npm and pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Gemini API Integration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Gemini API Integration use?

Gemini API Integration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gemini API Integration use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Gemini API Integration?

Skills that share tags, products or a category with Gemini API Integration: Gemini API Dev (google-gemini/gemini-skills, 4.3k stars), Gemini API Dev (Ayuilos/Miffan, 192 stars), Gemini API Dev (aiskillstore/marketplace, 430 stars) and Gemini API Dev (JetBrains/skills, 364 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gemini API Integration?

majiayu000 (a GitHub user) maintains it in majiayu000/claude-skill-registry, which has 666 GitHub stars. The repository holds 1,273 skills in this directory. The repository was last updated on October 7, 2026.

Source: majiayu000/claude-skill-registry on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.