gemini-api-dev: Aligning the Gemini Interactions API Development Paradigm with Agent Skills

Introduction

Starting from June 2026, Google has marked the Interactions API as Generally Available and recommends prioritizing it for new projects; the legacy generateContent remains available, but the documentation explicitly states that “new models, multimodality, tools, and Agent capabilities will be released first on the Interactions API.” If you are still using google-generativeai, hand-writing generateContent, or letting coding assistants guess the SDK based on training data, you are prone to falling into pitfalls such as deprecated models, incorrect endpoints, or missing conventions like previous_interaction_id.

Below is an introduction to the gemini-api-dev Skill maintained by Google in the google-gemini/gemini-skills repository. It targets scenarios involving text, multimodality, streaming, function calling, structured output, and migration from generateContent for the Gemini Interactions API. A note: the path skills/gemini-interactions-api mentioned in clues currently returns a 404 on the repository’s main branch; the official directory and installation name is gemini-api-dev, and the Interactions documentation also specifies that this Skill should be installed.

What is this

gemini-api-dev is a SKILL.md instruction set compliant with the Agent Skills specification, maintained by google-gemini/gemini-skills (Repository declaration: not an officially supported Google product). The Skill’s description specifies that it should be used when calling the Gemini API for text generation, multi-turn conversations, multimodal understanding, image/video/audio generation, streaming responses, background research tasks, function calling, structured output, or migrating from the legacy generateContent; it covers usage and best practices for both Python and TypeScript SDKs.

Unlike “just pasting a Quickstart,” the Skill emphasizes rules over outdated model knowledge: the model IDs to use currently, SDK packages and minimum version requirements, the Interaction data model (steps, streaming event types), and the requirement to fetch the corresponding hosted documentation pages before writing code.

Core Functions (Verified Scope)

Based on the SKILL.md and repository README, the capabilities covered by this Skill include:

  1. Interactions API Main Path: client.interactions.create / get, and response helper properties output_text, output_image, output_audio.
  2. Stateful Multi-turn: Chained continuation via previous_interaction_id; tools, system_instruction, and generation_config are interaction-scoped and must be passed again for each turn.
  3. Streaming: stream=True (Python) or stream: true (TypeScript), with event sequences including interaction.created, step.delta, interaction.completed, etc.
  4. Function Calling & Tool Ecosystem: The Skill lists documentation entries for Function Calling, Google Search, Code Execution, and Structured Output; step types include function_call / function_result.
  5. Agent: Deep Research (background=True polling), Managed Agents (e.g., antigravity-preview-09-2026, requires environment="remote"), Custom Agents (client.agents.create).
  6. Migration: The Skill requires reading the references/migration.md bundled with the Skill when migrating from generateContent, and confirming the scope of changes with the user.
  7. Storage & Compliance Defaults: Interactions default to store=true (retained for 55 days on paid tiers, 1 day on free tier); previous_interaction_id and background=true cannot be used when store=false.

The Skill explicitly requires the use of google-genai ≥ 2.30.1 (Python) and @google/genai ≥ 2.29.1 (JS/TS), and deprecates google-generativeai / @google/generative-ai. The real-time bidirectional Live API points to the gemini-live-api-dev Skill in the same repository and is not covered in this article.

The repository README mentions: When evaluating this series of Skills, after adding the Skill, the proportion of assistants generating correct API code according to best practices was approximately 87% on Gemini 3 Flash and 96% on Gemini 3.1 Pro (see the Google Developers Blog post Closing the knowledge gap with agent skills for details).

Installation and Activation

The Skill name used for installation is gemini-api-dev, not the invalid path gemini-interactions-api.

Vercel skills CLI (skills.sh):

# Browse and install
npx skills add google-gemini/gemini-skills --list

# Install gemini-api-dev only
npx skills add google-gemini/gemini-skills --skill gemini-api-dev

Context7:

npx ctx7 skills install /google-gemini/gemini-skills gemini-api-dev

Cursor:

/add-plugin google-gemini/gemini-skills

This installs the entire gemini-skills plugin set; Interactions-related development corresponds to the gemini-api-dev within it.

Claude Code:

/plugin marketplace add google-gemini/gemini-skills
/plugin install gemini-skills@gemini-skills

OpenAI Codex:

codex plugin marketplace add https://github.com/google-gemini/gemini-skills
codex plugin add gemini-skills@gemini-skills

Antigravity can have this plugin set built-in, or via:

agy plugin install https://github.com/google-gemini/gemini-skills

For more complete coding assistant + Gemini Docs MCP configuration, see Set up your coding agent.

Typical Usage

After enabling the Skill, when asking the assistant to “write a minimal runnable example according to the Interactions API,” it should land on interactions.create rather than generateContent. The following examples are from the official SKILL.md and are used to verify if the environment and Skill are working.

Python: Install the SDK first, then initiate a single text Interaction.

pip install -U google-genai
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Tell me a short joke about programming."
)
print(interaction.output_text)

TypeScript:

npm install @google/genai
import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    model: "gemini-3.8-flash",
    input: "Tell me a short joke about programming.",
});
console.log(interaction.output_text);

Stateful Second Turn (Same conversation chain):

interaction1 = client.interactions.create(
    model="gemini-3.8-flash",
    input="Hi, my name is Phil."
)
interaction2 = client.interactions.create(
    model="gemini-3.8-flash",
    input="What is my name?",
    previous_interaction_id=interaction1.id
)
print(interaction2.output_text)

Streaming Output (Excerpt for processing step.delta text):

for event in client.interactions.create(
    model="gemini-3.8-flash",
    input="Explain quantum entanglement in simple terms.",
    stream=True,
):
    if event.event_type == "step.delta" and event.delta.type == "text":
        print(event.delta.text, end="", flush=True)

The Skill requires: Before writing specific business code, fetch the corresponding ai.google.dev documentation based on the task from the Documentation Pages list in SKILL.md (e.g., Function Calling, Streaming), treating parameters and edge cases as the standard, with examples serving only as minimal demos.

Applicable Scenarios and Notes

Who it is for:

  • Building new or refactoring Gemini applications that need to uniformly use the Interactions API (text, multimodal, tools, Agent).
  • Using coding assistants like Cursor, Claude Code, Codex to generate SDK code, aiming to reduce deprecated APIs and incorrect model IDs.
  • Migrating from generateContent and needing checklist-style comparisons and guidance from references/migration.md.

Limitations and Pitfalls:

  • Use gemini-api-dev for the installation path; skills/gemini-interactions-api is currently inaccessible, do not install based on the incorrect directory name.
  • The Skill marks some gemini-2.x / gemini-1.5 as legacy; when coexisting with the Interactions officially supported model table, prioritize the API you intend to call and the models available to your account. When migrating, replace and inform the user as required by the Skill.
  • The Interactions API does not yet support the Batch API, Python automatic function calling, etc. (Official Limitations list); such requirements require continued evaluation of generateContent or other product capabilities.
  • Interactions are stored by default; if compliance requires a stateless approach, explicit store=false is needed, and the inability to chain previous_interaction_id must be accepted.
  • Repository Disclaimer: This project is not an officially supported Google open source product.

Conclusion

The Interactions API is already the default interface for new projects recommended by Google documentation; the gemini-api-dev Skill incorporates model/SDK constraints, the Interaction data model, streaming, and migration key points into the assistant’s context, bridging the documentation lag caused by model training cutoffs. If you are integrating your assistant into the Gemini development flow, you can first install the Skill via the commands above, then run through a minimal interactions.create example, and then fetch official documentation pages based on tasks to extend to function calling or multimodality.

Official Skill Directory: https://github.com/google-gemini/gemini-skills/tree/main/skills/gemini-api-dev
Interactions API Documentation: https://ai.google.dev/gemini-api/docs/interactions

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye