AI & DevelopmentDeveloper Tools

Gemini Interactions API: Migrate Before June 8

Developer screen showing Gemini API code migration from outputs array to steps array, blue and white color scheme
Gemini Interactions API schema change: outputs to steps — migrate before June 8, 2026

Google switched the default schema for its Gemini Interactions API today. If your application reads response.outputs anywhere, the deadline to fix it is June 8 — at which point the legacy schema is gone permanently, with no rollback. You have 13 days. This is not a soft deprecation.

The change comes in two parts, and both matter: the outputs array is replaced by a structured steps array, and response_mime_type is replaced by a new polymorphic response_format field. Whether you hit one or both depends on what your app does — but the first change affects every Interactions API user.

What Changed and Why

The old outputs array was a flat list of model-generated content. The new steps array is a full execution timeline: it includes model thoughts, function calls, search queries, tool results, and the final model output — each tagged with a type discriminator. Google needs this structure to ship mid-flight steering (the ability to redirect the model mid-generation) and async tool calls (non-blocking external API calls during inference). The outputs schema could not support either of those.

The response_mime_type change is narrower: it only affects apps that use structured JSON output or set explicit MIME types. The field is removed and replaced by a response_format array that consolidates all output format controls. If you do not use structured output, Change 2 does not touch your code.

Two Paths: SDK Users vs REST Users

If you use the Google GenAI SDK, the migration is lightweight. Upgrade to google-genai >= 2.0.0 (Python) or @google/genai >= 2.0.0 (JavaScript). The SDK wraps the new steps format internally and exposes convenience properties. Most reading code reduces to a single property swap:

# Before (breaks June 8)
text = response.outputs[0].text

# After — SDK convenience property
text = response.output_text

If you call the Interactions API directly over REST, the migration is more involved. You need to rewrite all outputs reads to traverse the steps array, update your SSE event listener to handle six new event types (interaction.created, interaction.in_progress, step.start, step.delta, step.stop, interaction.completed), and update any response_mime_type usage to response_format.

The Structured Output Change

If your app requests JSON output, this is the before and after:

# Before — response_mime_type removed June 8
interaction = client.interactions.create(
    model="gemini-3.5-flash",
    input="Summarize this document.",
    response_mime_type="application/json",
    response_schema=MySchema
)

# After — response_format replaces it
interaction = client.interactions.create(
    model="gemini-3.5-flash",
    input="Summarize this document.",
    response_format=[{
        "type": "text",
        "mime_type": "application/json",
        "schema": MySchema
    }]
)

The History Management Gotcha

SDK users commonly miss this one. Even with the latest SDK, conversation history still needs to be updated manually. If you maintain multi-turn conversations, you must pass response.steps — not response.outputs — when constructing the next request:

# Before (causes context loss after June 8)
next_turn = client.interactions.create(
    model="gemini-3.5-flash",
    input=user_message,
    history=prev_response.outputs
)

# After
next_turn = client.interactions.create(
    model="gemini-3.5-flash",
    input=user_message,
    history=prev_response.steps
)

This does not break on single-turn test inputs. It surfaces as context loss in multi-turn conversations — the model appears to “forget” previous turns. That makes it one of the harder failure modes to catch in testing.

What You Unlock After Migrating

The schema change is not cosmetic. Per Google’s official migration guide, new Interactions API features released after May 7 only appear in steps responses. Stay on outputs and you are locked out of anything new. Mid-flight steering, async tool calls, and richer streaming events are all gated behind migration. If you are building agents with Gemini 3.5 Flash — which scored 83.6% on the MCP Atlas agentic benchmark — migrating is the only way to access the capabilities that score was built on.

Temporary Opt-Out (For Teams That Need a Few More Days)

If you need a short runway to finish testing, add this header to your REST requests:

Api-Revision: 2026-05-07

This pins your requests to the legacy schema through June 7. After June 8, the header does nothing — the legacy schema is gone. Use it only as a buffer for teams mid-deployment, not as a substitute for migrating. The Gemini API changelog has the full timeline.

Migration Checklist

  • Upgrade SDK: pip install --upgrade google-genai or npm update @google/genai
  • Replace response.outputs[0].text with response.output_text
  • Replace response_mime_type with response_format (structured output only)
  • Update history passing: response.outputsresponse.steps (multi-turn apps)
  • Update SSE event listeners (REST users only)
  • Test structured output and multi-turn flows explicitly — not just happy-path
  • Remove Api-Revision: 2026-05-07 headers before June 8

The official migration guide covers every affected feature area with before/after examples. It is more thorough than most Google migration docs — worth a full read if your app does anything beyond basic single-turn text generation. You can also review the Interactions API reference for the updated field-by-field schema.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *