What a Gemini Interactions API response holds, in plain words

By Christophe Paka · Facts checked on 7 November 2026

The Gemini API is the door a program uses to ask Gemini questions without the chat app. Each question a program sends is called a call. What comes back is a Gemini Interactions API response: a labelled package, not just a line of text.

Read only the text, and a chatbot built on it forgets every earlier turn. Or it resends the whole chat each time and pays for it again.

This post opens the package one label at a time: the answer, the name tag and the log. You do not need to code to follow it. The names in code type are labels a programmer types.

An interaction package with three labelled slots. output_text holds the plain text answer. id names this exchange; reuse it as previous_interaction_id. steps records what the model did. Ignore them on a test call, not in a conversation.
Figure 5.1 Anatomy of an interaction: output_text answers a one off call; id and steps matter once you build a conversation.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Start at the answer slot. Each label in the figure names one slot of the reply, which programmers call a field. output_text is the plain text answer, the part a person reads. A one off question only needs this slot, and the first call in the book prints it and nothing else.

  2. Read the name tag. An interaction is one question and its answer. id is its name tag. On the next question, the program hands the tag back in a slot called previous_interaction_id, meaning the earlier exchange. Google's computers then pick up the chat where it stopped, so the program sends only the new message, not the whole history.

  3. Then read the log. steps is a log of what the model did before it answered. For a plain question, the log holds one entry: the answer itself. Switch on Google Search, and the log first lists the searches the model ran, then the results it read, then the answer. Older code examples on the web call this log outputs, its name before an API change.

  4. Obey the footer line. Ignore the three slots on a quick test call. Stop ignoring them the moment you build a real conversation, because the name tag links one turn to the next. The old and new call shapes show why that saves money.

Key takeaways

  • Read the answer slot for a one off question, and keep the name tag the moment you plan a second turn.
  • When an older code example reads a slot called outputs, rename it to steps before you run it.
  • On the paid tier, check the reply's usage counts too: the model's hidden reasoning is billed at the output price.

Worked example: a second turn that sends one sentence

A tea shop's help desk asks Gemini: Do you ship to Canada? The reply comes back as an interaction with its own id.

  1. The first call sends the question and shows the answer slot.
  2. The customer then asks: How long does it take?
  3. The second call sends only that sentence, plus the first call's name tag in the previous interaction slot.
  4. Google still holds the first exchange, so the model knows that it means shipping to Canada.

Result: Two short calls make a working conversation. That works while Google keeps the first call: one day on the free tier and 55 days on the paid tier, unless your request switches storage off.

Questions readers ask

Is the Gemini API the same as the Gemini app?

No. The Gemini app is the chat you type into. The API is how a program asks Gemini, and it has its own free tier and its own billing. A Google AI Pro plan does not pay for API use. To try prompts with no programming, use Google AI Studio, a free web page where you type a prompt and read the answer.

Why does my Gemini sample say outputs instead of steps?

The slot was renamed. It was called outputs before a change to the Interactions API, so older samples use the old name. Rename it to steps and the code reads the same log: what the model did on the way to its answer.

Do I have to send the whole chat on every turn?

Not on the Interactions API. Pass the earlier call's name tag as previous_interaction_id and send only the new message. The older generateContent call resends the whole chat every turn. So on turn 10 it sends all ten turns and pays for them again.

How long does Google keep my interaction?

Google keeps it one day on the free tier and 55 days on the paid tier, unless your request switches storage off. After that, the name tag cannot continue the chat. Keep customer data off the free tier, where Google uses your content to improve its products.

Sources: Gemini API quickstart (Google); SDKs and libraries (Google).

This figure is from Gemini Made Crystal Clear, chapter 5.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams