Prompt Buddy logoPrompt Buddy

google · Google AI Docs

Gemini API Migrating to the Interactions API

Provides a migration path for transitioning existing implementations to the new Interactions API, including handling breaking changes.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Gemini API Migrating to the Interactions API

Provides a migration path for transitioning existing implementations to the new Interactions API, including handling breaking changes.

When To Use

Use when updating existing Gemini API implementations to the Interactions API or preparing for the May 2026 breaking changes.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/gemini-api-migrating-to-the-interactions-workflow-guide.mdA guide detailing the migration process from the generateContent API to the Interactions API using Python.Questions about a guide detailing the migration process from the generateContent API to the Interactions API using Python.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python-.textA Python code snippet demonstrating the transition from the standard Gemini API to the new Interactions API using the genai client.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating the transition from the standard Gemini API to the new Interactions API using the...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-migrati.textA Node.js code example demonstrating the transition from the standard Gemini API to the Interactions API using the @google/genai library.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating the transition from the standard Gemini API to the Interactions API using the @g...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re.textA curl command demonstrating a POST request to the generateContent endpoint and its corresponding JSON response for the Gemini API.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the generateContent endpoint and its corresponding JSON response for t...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--2.textA Python code example demonstrating how to initialize the GenAI client and create a simple interaction using the new Interactions API.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initialize the GenAI client and create a simple interaction using the new...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs-.textA Node.js code example demonstrating how to use the new Interactions API to create an interaction and inspect model output steps.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the new Interactions API to create an interaction and inspect model o...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-2.textA curl command demonstrating a POST request to the Gemini API interactions endpoint with a JSON payload.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the Gemini API interactions endpoint with a JSON payload.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--3.textA Python code example demonstrating how to use the new genai client to create a chat session and send messages using the Interactions API.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the new genai client to create a chat session and send messages using...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--4.textA Python code example demonstrating how to implement multi-turn conversation history using the new Gemini Interactions API client.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to implement multi-turn conversation history using the new Gemini Interaction...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--2.textA Node.js code example demonstrating how to migrate chat interactions using the GoogleGenAI client library.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to migrate chat interactions using the GoogleGenAI client library.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-migrati-2.textA Node.js code example demonstrating how to migrate to the Interactions API by including full conversation history in the contents array for multi-turn requests.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to migrate to the Interactions API by including full conversation history in...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-mu.textA curl command demonstrating a multi-turn request to the Gemini API by including the full conversation history in the contents array.Exact payloads, commands, or snippets shown in A curl command demonstrating a multi-turn request to the Gemini API by including the full conversation history in the...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--5.textA Python code example demonstrating how to create multi-turn interactions using the Gemini API client.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to create multi-turn interactions using the Gemini API client.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--3.textA Node.js code example demonstrating how to migrate from the standard Gemini API to the Interactions API using the @google/genai library.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to migrate from the standard Gemini API to the Interactions API using the @g...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-3.textCurl commands demonstrating how to send initial and follow-up requests using the Gemini Interactions API endpoint.Exact payloads, commands, or snippets shown in Curl commands demonstrating how to send initial and follow-up requests using the Gemini Interactions API endpoint.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--6.textA Python code snippet demonstrating how to use the new genai client to call generatecontent with image bytes during the migration to the Interactions API.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the new genai client to call generatecontent with image bytes during t...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-migrate.textA curl command demonstrating the POST request structure for migrating to the Gemini API Interactions API.Exact payloads, commands, or snippets shown in A curl command demonstrating the POST request structure for migrating to the Gemini API Interactions API.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--7.textA Python code snippet demonstrating how to use the Gemini Interactions API to send an image and text prompt to a model.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the Gemini Interactions API to send an image and text prompt to a model.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--4.textA Node.js code example demonstrating how to create a new interaction using the Gemini API with text and image inputs.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a new interaction using the Gemini API with text and image inputs.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-4.textA curl command demonstrating a POST request to the Gemini API interactions endpoint with a multimodal payload.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the Gemini API interactions endpoint with a multimodal payload.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--8.textA Python code example demonstrating how to migrate from the standard GenerateContent method to the Interactions API using Pydantic models for structured responses.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to migrate from the standard GenerateContent method to the Interactions API u...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-generat.textA curl command demonstrating a POST request to the gemini-2.5-flash model using the generateContent endpoint.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the gemini-2.5-flash model using the generateContent endpoint.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--9.textA Python code example demonstrating how to use the Gemini Interactions API with Pydantic models for structured JSON responses.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Gemini Interactions API with Pydantic models for structured JSON r...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-create-.textA Node.js code example demonstrating how to use the GoogleGenAI client to create an interaction with a specified model and response format.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the GoogleGenAI client to create an interaction with a specified mode...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-5.textA curl command demonstrating a POST request to the Gemini API interactions endpoint with a JSON payload.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the Gemini API interactions endpoint with a JSON payload.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-respons.textA text representation of the response structure concept showing the candidates, content, and parts hierarchy for the Interactions API.Exact payloads, commands, or snippets shown in A text representation of the response structure concept showing the candidates, content, and parts hierarchy for the...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-respons-2.textA text representation of the new response structure concept including id, steps, and content types for the Interactions API.Exact payloads, commands, or snippets shown in A text representation of the new response structure concept including id, steps, and content types for the Interactio...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--10.textA Python code example demonstrating how to use the Google Search tool within the generateContent method to access grounding metadata and citations.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Google Search tool within the generateContent method to access gro...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--5.textA Node.js code example demonstrating how to use the Interactions API to generate content with Google Search grounding metadata.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Interactions API to generate content with Google Search grounding...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-migrate-2.textA curl command demonstrating the request and response structure for migrating to the Gemini API Interactions API.Exact payloads, commands, or snippets shown in A curl command demonstrating the request and response structure for migrating to the Gemini API Interactions API.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--11.textA Python code snippet demonstrating how to use the genai client to create an interaction with Google Search tool integration.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the genai client to create an interaction with Google Search tool inte...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--6.textA Node.js code example demonstrating how to create a new interaction using the Gemini API with Google Search tools.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a new interaction using the Gemini API with Google Search tools.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-6.textA curl command demonstrating a POST request to the Gemini Interactions API endpoint and the resulting JSON response containing grounding information.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the Gemini Interactions API endpoint and the resulting JSON response c...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--12.textA Python code example demonstrating the transition from generatecontent to the Interactions API using the google-genai SDK.Exact payloads, commands, or snippets shown in A Python code example demonstrating the transition from generatecontent to the Interactions API using the google-gena...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--7.textA Node.js code example demonstrating how to use the generateContent method with tools to trigger function calls using the Gemini Interactions API.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the generateContent method with tools to trigger function calls using...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-ge.textA curl command demonstrating a POST request to the generateContent endpoint for migrating to the Interactions API.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the generateContent endpoint for migrating to the Interactions API.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--13.textA Python code example demonstrating how to initialize the GenAI client and create an interaction using the new Interactions API with a function tool.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initialize the GenAI client and create an interaction using the new Intera...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--8.textA Node.js code example demonstrating how to migrate function calling tool definitions to the new Gemini Interactions API.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to migrate function calling tool definitions to the new Gemini Interactions...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-in.textA curl command demonstrating the initial POST request structure for the Gemini API Interactions endpoint.Exact payloads, commands, or snippets shown in A curl command demonstrating the initial POST request structure for the Gemini API Interactions endpoint.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--14.textA Python code example demonstrating how to use the generate_content_stream method to stream responses from the Gemini API.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the generatecontentstream method to stream responses from the Gemini API.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--9.textA Node.js code example demonstrating how to migrate from the legacy generateContent method to the new generateContentStream method using the Interactions API.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to migrate from the legacy generateContent method to the new generateContent...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-7.textA curl command demonstrating a POST request to the streamGenerateContent endpoint for migrating to the Interactions API.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the streamGenerateContent endpoint for migrating to the Interactions API.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--15.textA Python code snippet demonstrating how to use the genai client to create a streaming interaction with the Gemini API.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the genai client to create a streaming interaction with the Gemini API.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--10.textA Node.js code example demonstrating how to use the GoogleGenAI client to create a streaming interaction with the Gemini API.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the GoogleGenAI client to create a streaming interaction with the Gem...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--16.textA Python code example demonstrating how to use the generatecontentstream method with the new Google GenAI SDK to handle complete function call arguments.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the generatecontentstream method with the new Google GenAI SDK to hand...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--11.textA Node.js code example demonstrating how to use the generateContentStream method with the new Interactions API structure.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the generateContentStream method with the new Interactions API struct...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-8.textA curl command demonstrating a POST request to the streamGenerateContent endpoint for migrating to the Interactions API.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the streamGenerateContent endpoint for migrating to the Interactions API.
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-python--17.textA Python code example demonstrating how to initialize the GenAI client and create a streaming interaction using the new Interactions API.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initialize the GenAI client and create a streaming interaction using the n...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-nodejs--12.textA Node.js code example demonstrating how to use the GoogleGenAI client to create a streaming interaction with the Gemini API.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the GoogleGenAI client to create a streaming interaction with the Gem...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-curl-re-9.textA curl command demonstrating a POST request to the Gemini API interactions endpoint with a model, input, and tool definition.Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the Gemini API interactions endpoint with a model, input, and tool def...
examples/gemini-api-migrating-to-the-interactions-gemini-api-interactions-server-.textTextual representation of step.start and step.stop events containing tool call payloads for the Gemini Interactions API.Exact payloads, commands, or snippets shown in Textual representation of step.start and step.stop events containing tool call payloads for the Gemini Interactions API.

What This Skill Covers

  • This guide helps you migrate from the generateContent API to the Interactions API.
  • Main sections: Why migrate?, Basic input/output, Before ( generateContent ), Python, JavaScript.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://ai.google.dev/gemini-api/docs/migrate-to-interactions