Interactions API returns 400 'invalid_request' when chaining a multimodal text model to an image generation turn via previous_interaction_id

Hello,

I have been trying to fix a bug with my Interactions API where I am following a Nano Banana interaction with a text interaction, linked using the previous_interaction_id.

I have come to the conclusion that it’s not fixable my end.

I have tried a minimal reproduction:

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

const ai = new GoogleGenAI();

async function reproduceBug() {

console.log("Generating image...");
const imageTurn = await ai.interactions.create({
model: "gemini-3.1-flash-image", 
input: "A watercolor painting of a red bicycle",
response_format: { type: "image" },
store: true
});

console.log("Image Interaction ID:", imageTurn.id);

console.log("Attempting to follow up with text model...");
const textTurn = await ai.interactions.create({
model: "gemini-3.5-flash-lite", 
input: "What color is the bicycle in the image you just generated?",
previous_interaction_id: imageTurn.id,
store: true
});

console.log("Assistant Response:", textTurn.output_text);
}

reproduceBug();

And it is still giving me this error:

{
"error": {
"message": "Request contains an invalid argument.",
"code": "invalid_request"
}
}

I can carry on the conversation with another Nano Banana image, but not a text one. I have tried sending another image alongside the text to see if it triggers image understanding but it doesn’t work either.

According to the Interactions API documentation under Multi-turn model compatibility:

"When mixing different models in a conversation (either stateful or stateless), subsequent models must support the output modalities of the previous models as input. For example, if you generate an image using gemini-3.1-flash-image, *you cannot continue that conversation with a model that doesn’t accept image inputs…"
*
So it should work.

It’s not the end of the world and I have communicated this to staff and people are working around it by making new chats and continuing Nano Banana chats with images but I just wanted to flag this.

I am using a Node server to hide the API key and “@google/genai”: “^2.27.0”.

Thank you

Hello,

I was hoping that providing a minimal reproduction case would help move this forward, but has anyone had a chance to recreate or investigate this issue?

As an additional test, I recently added the latest Omni model to my Interactions API workflow. Based on my testing, it still appears that a Nano Banana generation within the interaction chain is the root cause of the problem.

Here are my findings:

I can successfully run the following interaction chain:

text → text → Nano Banana image → Omni video → Nano Banana image :white_check_mark:

This suggests that once an image has been generated in the interaction chain, it is possible to continue with either another image generation or a video generation.

However, if I attempt to generate text after a Nano Banana interaction, I receive the same error described in my original post:

text → text → Nano Banana image → Omni video → Nano Banana image → text :cross_mark:

I can also successfully run:

text → Omni video → text :white_check_mark:

This demonstrates that text generation can continue after an Omni video generation, which appears to rule out non-text generations in general as the cause of the issue.

The error also occurs with:

text → Nano Banana image → Omni video → text :cross_mark:

In this case, the text interaction follows an Omni video generation. Since the equivalent workflow works when Nano Banana is not present in the chain, this again points to Nano Banana as the common factor.

Based on all of the testing above, it appears that Nano Banana interactions are causing a compatibility issue that prevents subsequent text generations from working correctly within the interaction chain.

It would be great if someone could confirm this behaviour so I can adapt to it or wait for a fix.

Thank you

Hello @Elliot_O ,

Thanks for reporting this — we have reproduced this behavior and forwarded the issue to the relevant team. In the meantime, you can use either of the following workarounds when continuing with a text model (gemini-3.5-flash-lite or gemini-3.8-flash) after a gemini-3.1-flash-image turn:

  • Start a new stateful interaction with the generated image as input: Extract the generated image (data and mime_type) from the gemini-3.1-flash-image response, create a new interaction (store: true, without previous_interaction_id) passing that image and your text prompt in input, and then continue chaining subsequent turns from that new interaction’s id using previous_interaction_id.
  • Pass the history statelessly without the image turn’s thought step: When sending the conversation history as an input step array without previous_interaction_id, omit the thought step (type: "thought") from the gemini-3.1-flash-image turn and keep only the image output step before appending your next text turn.