google-genai-sdk-python

google-genai-sdk-python is a skill for Claude Code, Codex from cnemri/google-genai-skills. It costs 48 tokens per session (390 once invoked), scanned A, original, MIT.

A reference guide for writing Python programs with Google’s official GenAI SDK, the library used to call Gemini and Vertex AI models. It covers text, images, audio, video, PDFs, tools, and generated media.

In plain words
What is it for?
Use it when building Python code for text generation, chats, reasoning settings, JSON or Pydantic outputs, tool calling, code execution, search grounding, or media generation.
Why use it?
It helps developers choose the relevant SDK patterns for authentication, model calls, structured results, conversations, and multimodal input.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building Python code for text generation, chats, reasoning settings, JSON or Pydantic outputs, tool calling, code execution, search grounding, or media generation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cnemri/google-genai-skills/google-genai-sdk-python
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cnemri/google-genai-skills --skill google-genai-sdk-python
Clone the repo
git clone --depth 1 https://github.com/cnemri/google-genai-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for google-genai-sdk-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/cnemri/google-genai-skills/google-genai-sdk-python/github.svg)](https://agentmods.dev/skills/cnemri/google-genai-skills/google-genai-sdk-python)
Your own site
<a href="https://agentmods.dev/skills/cnemri/google-genai-skills/google-genai-sdk-python"><img src="https://agentmods.dev/badge/skills/cnemri/google-genai-skills/google-genai-sdk-python/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for google-genai-sdk-python

Your own site · 80×15
<a href="https://agentmods.dev/skills/cnemri/google-genai-skills/google-genai-sdk-python"><img src="https://agentmods.dev/badge/skills/cnemri/google-genai-skills/google-genai-sdk-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 390 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.00390
Opus 5.5 $0.00019 $0.00156
Sonnet 5.5 $0.00010 $0.00078
Haiku 4.5 $0.00005 $0.00039

Measured 2mo ago against content hash 303836ac986d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

google-genai-sdk-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/google-genai-sdk-python/SKILL.md · 30 lines

What it actually says

Google GenAI Python SDK Skill

Use this skill to write high-quality, idiomatic Python code for the Gemini API.

Reference Materials

Identify the user's task and refer to the relevant file:

  • Setup & Client: Installation, auth, client initialization.
  • Models: Recommended models (Flash, Pro, Lite, Imagen, Veo).
  • Text Generation: Basic inference, streaming, system instructions, safety.
  • Chat: Multi-turn conversations and history.
  • Reasoning: Thinking config (thinking_level / thinking_budget), thought signatures.
  • Structured Output: JSON schemas, Pydantic models, Enums.
  • Multimodal Inputs: Images, audio, video, PDFs, media resolution.
  • Tools: Function calling, code execution, Google Search grounding.
  • Media Generation: Image generation/editing (Imagen), video generation (Veo).
  • Source Code: Raw SDK source code for deep inspection.

Core Principles

  1. Unified SDK: Always use google-genai.
  2. Stateless Models: Use client.models for single requests.
  3. Stateful Chats: Use client.chats for conversations.
  4. Types: Import from google.genai.types.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 30 lines · 48 tokens per session scan A 303836ac986d

Subscribe to this mod's changes

google-genai-sdk-python is a skill published in the GitHub repository cnemri/google-genai-skills (129 stars, last pushed 9mo ago), licensed MIT. It adds 48 tokens to every session and 390 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

google-genai-sdk-python compared with skills from other repositories

google-genai-sdk-python next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
google-genai-sdk-pythoncnemri/google-genai-skillsSkill1299mo agoMITA48Claude Code, Codex
accelerateNousResearch/hermes-agentSkill261kyesterdayMITA13Claude Code, Codex
pytorch-patternsaffaan-m/ECCSkill298k4d agoMITA32Claude Code, Kiro
optimize-for-gpuK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA151Claude Code, Codex
developing-genkit-pythongoogle/skillsSkill22kyesterdayApache-2.0A49Claude Code, Codex
marimo-pairmarimo-team/marimoSkill23kyesterdayApache-2.0A57Claude Code, Codex
azure-mgmt-fabric-pymicrosoft/skillsSkill3.2kyesterdayMITA51Claude Code