Skip to content

Guide · Agent skill

How to use the Gemini Interactions API Guide agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The gemini-interactions-api skill is a set of instructions that teaches an AI coding agent how to authenticate to Google Cloud, set up the Google Gen AI SDK, and call Gemini's stateful Interactions API. It is written for developers building chatbots, multi-turn assistants or long background research tasks on Google Cloud. After this guide you will know how to install the skill, ask for it in plain language, and what it needs before it will run.

Gemini Interactions API Guidegoogle/skills · Apache-2.0

Quick start

  1. 1Download the ZIP. Download the gemini-interactions-api ZIP file from this page.
  2. 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder.
  3. 3Prepare Google Cloud. Log in with gcloud auth application-default login and enable aiplatform.googleapis.com.
  4. 4Install the current SDK. Install google-genai 2.3.0 or later for Python, or @google/genai 2.3.0 or later for JS/TS.
  5. 5Ask for what you need. Describe a task such as a multi-turn chatbot, streaming output or a background research job, naming your language.
  6. 6Review the code. Check model IDs against the linked docs and decide whether server-side storage is acceptable before running it.

What is an agent skill and what does this one do?

An agent skill is a folder containing a SKILL.md file and optional reference documents. When it is installed, an agent such as Claude can read those instructions and follow them when a task matches the skill's description.

This skill covers the Gemini Interactions API on Gemini Enterprise Agent Platform. Its guidance includes authenticating with Application Default Credentials, initializing the client with environment variables or inline parameters, single-turn and multi-turn requests, real-time streaming, background execution, structured output and function calling.

  • Stateful multi-turn conversations: the API stores conversation state on Google's servers so follow-up messages can refer to earlier turns.
  • Background execution for long-running tasks.
  • Streaming responses as typed events.
  • Warnings about legacy SDKs and deprecated model names.

How do you install the gemini-interactions-api skill?

Download the ZIP file from this page and unzip it. You can install the skill in one of two places.

For a personal install across all your projects, unzip it into ~/.claude/skills/. To limit it to one project, unzip it into that project's .claude/skills/ folder.

If you use the Claude apps instead, open Settings, go to Capabilities, and upload the skill under Skills.

  • Personal: ~/.claude/skills/
  • Single project: .claude/skills/ inside your project folder
  • Claude apps: Settings → Capabilities → Skills

What do you need before the skill works?

The skill assumes a Google Cloud project with the aiplatform API enabled, the gcloud CLI with Application Default Credentials, and a current Gen AI SDK. The source requires google-genai Python SDK 2.3.0 or later, or @google/genai JS/TS SDK 2.3.0 or later. An API key is optional and only needed for express mode.

The skill also says that legacy packages such as google-cloud-aiplatform, google-generativeai and @google/generative-ai are not supported for Interactions. Use the current Gen AI SDK instead.

  • Google Cloud project with the aiplatform API enabled
  • gcloud CLI with Application Default Credentials
  • google-genai (Python) or @google/genai (JS/TS) version 2.3.0 or later
  • Optional: an API key for express mode
gcloud auth application-default login gcloud services enable aiplatform.googleapis.com

How do you trigger the skill with a natural request?

You do not need to name the skill. Describe a task that matches its purpose and the agent should pick it up. The skill's description mentions multi-turn conversations, background execution, streaming, structured output and function calling on the Agent Platform, so requests using those words are the clearest triggers.

Mention Gemini and the Interactions API explicitly when you can, and name the language you are coding in.

  • "Build a Python chatbot on the Gemini Interactions API that remembers my name across turns."
  • "Set up a background research task with the Gemini Interactions API and show me how to poll for the result."
  • "Stream a Gemini Interactions API response in TypeScript."
  • "Migrate my google-generativeai code to the Gen AI SDK using the Interactions API."

What does a multi-turn example look like?

Interactions are stateful by default. The first turn stores its state, and the second turn refers to it through previous_interaction_id. The example below is taken from the skill's Python guidance.

Storage is on by default and kept for 7 days. Passing store=False turns off server-side retention, which also disables previous_interaction_id and background.

turn1 = client.interactions.create( model="gemini-3.8-flash", input="Hi! My name is John. I am working on AI agents.", store=True ) turn2 = client.interactions.create( model="gemini-3.8-flash", input="What is my name?", previous_interaction_id=turn1.id ) print(f"Turn 2: {turn2.output_text}")

What safety and privacy points should you know?

This skill does not run scripts, but it does use the network, because it calls Google Cloud APIs. Commands the agent runs in your terminal are tagged with an attribution string that identifies only the skill and its version. The skill's attribution reference says the tag carries no user data.

Interactions are stored server-side by default. If your project must keep data off server-side storage, set store=False and accept that previous_interaction_id and background will not work. Model IDs are hardcoded in the skill and may change, so check them against the linked docs before shipping.

  • Runs scripts: no
  • Uses network: yes
  • Default retention: 7 days unless store=False is set
  • The skill tags gcloud commands with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION rather than changing your gcloud config

What tips help the agent give better code?

Ask for the environment-variable setup if you want the least code. Ask for a specific language, since the skill includes both Python and TypeScript/JavaScript examples. If you need a deprecated model, the skill tells the agent to substitute gemini-3.8-flash and say so.

Keep in mind that tools, system_instruction and generation_config are turn-scoped, so they must be sent with every request rather than once.

  • Name the language (Python or TypeScript) in your request.
  • Ask for environment variables or inline parameters, depending on your setup.
  • Check model IDs against Google's model migration docs before production use.
  • Expect the agent to re-send tools and system instructions on every turn.

What people use it for

  • Building a customer-support chatbot that remembers earlier turns in the same conversation.
  • Running a long background research task and retrieving the result later.
  • Streaming a Gemini answer into a web interface as it is generated.
  • Adding function calling so Gemini can request data from your own code.
  • Migrating an older Google AI SDK project to the current Gen AI SDK.

Frequently asked questions

Is the gemini-interactions-api skill free?

The skill is published under the Apache-2.0 licence. Using it does not require a separate purchase, but calling Gemini on Google Cloud is billed through your Google Cloud project, and the source does not give prices.

What do I need to install before using this skill?

You need a Google Cloud project with the aiplatform API enabled, the gcloud CLI with Application Default Credentials, and google-genai 2.3.0 or later for Python or @google/genai 2.3.0 or later for JS/TS. An API key is optional for express mode.

Where do I put the skill folder for Claude?

Unzip the downloaded ZIP into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project. In the Claude apps you can instead upload it under Settings, then Capabilities, then Skills.

Why does my code fail with google-cloud-aiplatform or google-generativeai?

The skill states that these legacy packages are strictly unsupported for the Interactions API. Replace them with the Google Gen AI SDK, google-genai for Python or @google/genai for JS/TS, at version 2.3.0 or later.

Does the Interactions API store my conversations?

Yes, by default. The skill says interactions are stored for 7 days unless you pass store=False. Note that store=False also disables previous_interaction_id and background execution.

Does this skill run code on my machine?

No, the skill does not run scripts. It does use the network to reach Google Cloud APIs, and any terminal gcloud commands it runs are tagged with an attribution string.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits developers building multi-turn assistants, chatbots or background research tools on Google Cloud who want an agent to handle authentication and current SDK usage. Skip it if you only want to chat with Gemini, if your data must stay off server-side storage, or if you need guaranteed-current model names without checking the docs yourself.

Download the skill