Agent skill · Backend & API

gemini-api

Patterns for using Google Gemini API with structured output, JSON mode, and proper configuration. Apply when implementing AI features, text generation, or working with Gemini models.

majiayu000github.com/majiayu000GitHub ↗
claude-codecan modify filesMIT
Install
npx skills add majiayu000/claude-skill-registry --skill gemini-api --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Allowed tools: ReadEditWriteGrepGlob
Path: skills/ai-llm/gemini-api/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Gemini API Patterns ## SDK Setup Use the `@google/genai` package with Expo Constants for API key management: ```typescript import { GoogleGenAI } from '@google/genai'; import Constants from 'expo-constants'; const genAI = new GoogleGenAI({ apiKey: Constants.expoConfig?.extra?.geminiApiKey as string }); ``` ## Available Models | Model | ID | Best For | |-------|-----|----------| | Gemini 3 Pro | `gemini-3-pro-preview` | Advanced reasoning, complex tasks | | Gemini 3 Flash | `gemini-3-flash-preview` | Balanced speed/intelligence | | Gemini 2.5 Flash | `gemini-2.5-flash` | Price-performance, scale | | Gemini 2.5 Flash-Lite | `gemini-2.5-flash-lite` | High-throughput, cost-efficient | | Gemini 2.5 Pro | `gemini-2.5-pro` | Complex reasoning, code, math | All models support 1M input tokens and 65K output tokens. ## Basic Text Generation ```typescript const response = await genAI.models.generateContent({ model: 'gemini-3-flash-preview', contents: 'Your prompt here', }); const text = response.text ?? ''; ``` ## Structured Content Format For multi-turn or complex inputs, use the full contents structure: ```typescript const response = await genAI.models.generateContent({ model: 'gemini-3-f

What's inside
Steps it walks through
  1. SDK Setup
  2. Available Models
  3. Basic Text Generation
  4. Structured Content Format
  5. System Instructions
  6. JSON Mode (Structured Output)
  7. With JSON Schema (Zod)
  8. Configuration Options
  9. Temperature Warning
  10. Error Handling Pattern
  11. Multi-Turn Chat
  12. Best Practices
  13. Common Mistakes to Avoid
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the gemini-api skill do?

Patterns for using Google Gemini API with structured output, JSON mode, and proper configuration. Apply when implementing AI features, text generation, or working with Gemini models.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill gemini-api --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going