Gemini API Breaking Changes: June 8 Migration Deadline


Most Gemini developers discovered this week that the API they’ve been using quietly changed its default schema on May 26. The old schema disappears permanently on June 8. If your production code reads from the outputs array instead of the steps array, you have roughly ten days to fix it before your application breaks.

This isn’t a gradual deprecation. Google is removing the legacy response structure entirely. Applications that worked yesterday will start throwing errors next week unless you update your response parsing logic.

AspectWhat Changed
Response structureoutputs array replaced with steps array
SDK requirementPython 2.0.0+ or JavaScript 2.0.0+ required
Legacy cutoffJune 8, 2026 (permanent removal)
Temporary opt-outApi-Revision: 2026-05-07 header until deadline

What Actually Changed

The Interactions API restructured how responses come back from Gemini. The old approach returned a flat outputs array containing only model-generated content. The new approach returns a steps array that includes type discriminators and provides a structured timeline of each interaction turn.

This matters because any code that accesses response.text or iterates through response.candidates[0].content.parts will fail after June 8. The new pattern requires you to access interaction.steps and handle both user_input and model_output step types.

The response_format parameter also changed. Google consolidated all output controls into a polymorphic object with type discriminators for text, audio, and image outputs. The old response_mime_type parameter no longer exists.

For developers working with multiple AI models in production systems, this change highlights why provider abstraction layers matter. Vendor-specific response structures can shift without warning.

Migration Timeline

Google rolled this out in phases, but the final deadline is firm.

May 7 marked the opt-in period where new SDK versions became available. Python developers could upgrade to version 2.0.0 and start using the new schema immediately. REST API users could add the Api-Revision: 2026-05-20 header to access the new structure early.

May 26 flipped the default. The new schema now applies to all API requests unless you explicitly opt out. If you haven’t tested your code against the new response format, you’re already running on different behavior than you expect.

June 8 removes the escape hatch. The legacy schema disappears completely. The temporary opt-out header stops working. Older SDK versions that relied on the old response structure will break.

How to Migrate

SDK users have the easiest path. Upgrade to Python 2.0.0+ or JavaScript 2.0.0+ and the SDK handles the new schema automatically. You still need to update how you read responses, but authentication and request formatting stay the same.

The key code changes involve response parsing. Replace response.text with interaction.output_text or access the last step directly through interaction.steps[-1].content[0].text. If you were iterating through response.candidates[0].content.parts, switch to iterating through interaction.steps.

REST API users need header updates. Add Api-Revision: 2026-05-20 to your requests now to start receiving the new format. Update your response parsing logic to handle the steps array structure. Test thoroughly before June 8.

For teams managing Gemini implementations alongside other providers, consider building a response normalization layer that handles provider-specific structures internally.

Response Format Changes

The new schema introduces explicit type discriminators. When you create an interaction, the response contains typed steps that clearly indicate whether each element is user_input or model_output.

For text responses, the structure moved from a flat MIME type parameter to a nested format:

response_format={
    "type": "text",
    "mime_type": "application/json",
    "schema": {...}
}

Image generation moved from generation_config to response_format with its own type discriminator. If you’re generating images through Gemini, verify your configuration uses the new parameter locations.

Warning: Streaming responses also changed event types. The new schema uses interaction.created, step.delta, and interaction.completed instead of the legacy interaction.start, content.delta, and interaction.complete events. Real-time applications need event handler updates.

Conversation History Management

Developers managing stateless conversation history face an additional change. The old pattern passed the outputs array in the input field of subsequent requests. The new pattern requires passing the steps array instead.

This affects any application that maintains conversation context across multiple API calls. Chatbots, multi-turn assistants, and interactive agents all need their context management updated.

Test your conversation flows end-to-end. A simple request-response test won’t catch issues with multi-turn context passing.

Why This Matters for AI Engineers

Breaking changes like this arrive regularly in the AI API space. Providers iterate quickly, and deprecation timelines compress. The engineers who handle these transitions smoothly share common practices.

They maintain staging environments where they can test against new API versions before production switches over. They build abstraction layers that isolate provider-specific code from business logic. They monitor changelogs and actually read the migration guides before deadlines hit. Understanding why production AI code breaks helps you build more resilient systems.

The Gemini migration is a clear example. Google announced these changes weeks ago. Developers who subscribed to the changelog caught it early. Those who didn’t are now scrambling with a ten-day window.

For a broader understanding of how to implement Gemini effectively, the fundamentals remain the same even as response structures evolve.

Temporary Workaround

If you can’t complete the migration before June 8, you have one option: pin to the legacy schema using the Api-Revision: 2026-05-07 header while you finish updates.

This buys you time for testing but stops working on June 8. Treat it as a bridge, not a solution. Schedule dedicated migration time this week.

Frequently Asked Questions

Will my code break automatically on June 8?

Yes, if you’re using the outputs array or old response_mime_type parameter. The API will return errors for any request expecting the legacy response structure.

Do I need to update my SDK version?

Yes. Python users need version 2.0.0 or higher. JavaScript users need the same. Older SDK versions only support the legacy schema that’s being removed.

What if I’m using Gemini through a third-party wrapper?

Check if your wrapper library has released an update for the new Interactions API. If not, you may need to switch to the official SDK or contact the library maintainer.

Does this affect Vertex AI users?

The same schema changes apply to the Vertex AI SDK. Check Google’s Vertex documentation for enterprise-specific migration guidance.

Sources

If you want to build AI systems that handle vendor changes gracefully, join the AI Engineering community where we discuss production architecture patterns and share migration strategies when providers shift their APIs.

Inside the community, you’ll find engineers who’ve navigated these transitions across OpenAI, Anthropic, Google, and smaller providers.

Zen van Riel

Zen van Riel

Senior AI Engineer | Ex-Microsoft, Ex-GitHub

I went from a $500/month internship to Senior AI Engineer. Now I teach 30,000+ engineers on YouTube and coach engineers toward six-figure AI careers in the AI Engineering community.

Blog last updated