gemini-interactions-api

Implements Gemini API calls using the Interactions API in Python and TypeScript.

Updated May 23, 2026
One-click install
npx skills add https://github.com/kiranimmadi2/promptforge-ai --skill gemini-interactions-api-kiranimmadi2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gemini-interactions-api
Source: https://github.com/kiranimmadi2/promptforge-ai/tree/main/gemini-skills/skills/gemini-interactions-api
Command: npx skills add https://github.com/kiranimmadi2/promptforge-ai --skill gemini-interactions-api-kiranimmadi2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-genai, @google/genai, and includes references (resource) components.

What problem does it solve? Developers writing code against the Gemini API often rely on outdated knowledge of deprecated models, legacy SDKs, and the old generateContent API, producing broken or obsolete code. This Skill provides current model names, SDK versions, the new steps-based response schema, and migration guidance so generated code works with the Interactions API. ## Core Features & Use Cases - Current API Patterns: Provides working examples for text generation, multi-turn conversations via previous_interaction_id, streaming with step.delta events, and background agents in Python and TypeScript. - Managed and Custom Agents: Covers the Antigravity agent, Deep Research agents, and custom agent creation with sandboxed remote environments. - Migration Support: Includes a reference guide for migrating from generateContent to the Interactions API, replacing deprecated model strings, and upgrading to Gemini 3.5 Flash. - Use Case: A developer asks to add streaming chat to an app using gemini-2.0-flash. The Skill substitutes gemini-3.5-flash, uses client.interactions.create with stream=True, and handles step.delta events correctly. ## Quick Start Ask the AI to write a Python script that calls the Gemini Interactions API with gemini-3.5-flash to generate a short text response.

Frequently Asked Questions about gemini-interactions-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call the Gemini API with the Interactions API in Python?

Install google-genai version 2.0.0 or higher, create a client with genai.Client(), and call client.interactions.create with a model like gemini-3.5-flash and your input. Read the response text from interaction.steps[-1].content[0].text.

How do I migrate from generateContent to the Interactions API?

Replace client.models.generate_content() with client.interactions.create(), read responses from interaction.steps instead of response.text, and use previous_interaction_id for multi-turn conversations. The references/migration.md file contains a full checklist and model replacement table.

Which Gemini models should I use instead of gemini-2.0 or gemini-1.5?

Models like gemini-2.0-flash and gemini-1.5-pro are deprecated and should be replaced with gemini-3.5-flash. For lightweight tasks use gemini-3.1-flash-lite-preview, and for complex reasoning use gemini-3.1-pro-preview.

Does the Interactions API support streaming responses?

Yes, pass stream=True to client.interactions.create and iterate over events. Text arrives in step.delta events with delta type text, and interaction.complete provides final token usage.

How do I run a deep research task with the Gemini API?

Use the deep-research-preview-04-2026 agent with background=True, then poll client.interactions.get until the status is completed. Deep Research Max offers maximum exhaustiveness for larger investigations.

Why does my old Gemini code break with SDK version 2.0.0?

SDK 2.0.0 uses the new steps array instead of outputs and a polymorphic response_format instead of response_mime_type. Legacy packages google-generativeai and @google/generative-ai are deprecated and must be replaced.