gemini-interactions-api
Use this skill when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, streaming responses, background research tasks, function calling, structured output, or migrating from the old generateContent API. This skill covers the Interactions API, the recommended way to use Gemini models and agents in Python and TypeScript.
Security Assessment
About gemini-interactions-api
The `gemini-interactions-api` skill is designed to facilitate interactions with the Gemini API, enabling developers to leverage advanced AI models for a variety of tasks. This skill abstracts the complexity of direct API calls and provides a unified interface for creating text generation, multi-turn chat, and multimodal interactions, including image generation and understanding. It ensures that developers can efficiently use Gemini models and agents in Python and TypeScript environments, while adhering to the latest API standards and schemas. By centralizing API interactions, it helps solve problems related to managing conversation context, structured outputs, function calls, and transitioning from legacy APIs like `generateContent`.
FAQ
Which models are currently recommended for use?
The skill supports a range of Gemini models including `gemini-3.1-pro-preview`, `gemini-3-flash-preview`, `gemini-3.1-flash-lite-preview`, `gemini-3-pro-image-preview`, `gemini-3.1-flash-image-preview`, `gemini-3.1-flash-tts-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, and Gemma models like `gemma-4-31b-it` and `gemma-4-26b-a4b-it`. Deprecated models such as `gemini-2.0-*` and `gemini-1.5-*` should not be used.
What SDKs are compatible with this skill?
For Python, use `google-genai` version 2.0.0 or higher. For JavaScript/TypeScript, use `@google/genai` version 2.0.0 or higher. Legacy SDKs are deprecated and should be avoided.
How are interactions stored and managed?
By default, interactions are stored (`store=true`). Paid tier retains interactions for 55 days, free tier for 1 day. Setting `store=false` disables retention and features like `previous_interaction_id` and background tasks. Interaction-scoped options like `tools`, `system_instruction`, and `generation_config` must be specified each turn.
Are there breaking changes or new schemas to be aware of?
Yes. As of May 2026, responses use a `steps` array instead of `outputs`, and a polymorphic `response_format` replaces `response_mime_type`. Legacy schemas were removed on June 8, 2026.
Who should use this skill and for what use cases?
This skill is intended for developers, researchers, and engineers who need programmatic access to Gemini AI models for text generation, multi-turn conversation, image tasks, streaming responses, structured outputs, or API migration from older endpoints. It's suitable for building chatbots, AI research tools, content generation, and multimodal applications.
Install gemini-interactions-api
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
google-gemini/gemini-skills