APIYI gateway status (tested July 4, 2026 (UTC+8)): the Interactions API is not yet supported through the gateway — both
/v1beta2/interactions and /v1beta/interactions return 404. When calling Gemini via APIYI, keep using the generateContent native format; all Gemini docs on this site are based on it. We will update this page once the gateway adds Interactions API support.What the Two Paradigms Are
generateContent is the classic stateless interface: one request carries the full context, one response returns the full result, atPOST /v1beta/models/{model}:generateContent. Google states that “while it is now considered legacy, it remains fully supported.”
The Interactions API is Google’s new interface, GA since June 2026, at POST /v1beta2/interactions. It is built around the core Interaction resource (one complete conversation turn or task), and the response is a chronological timeline of execution steps — model thoughts, tool calls and results, and the final output are all explicit steps. Google is explicit that new models beyond the core mainline family and new agentic capabilities will launch on the Interactions API going forward (source: ai.google.dev/gemini-api/docs/interactions-overview).
Core Differences at a Glance
| Dimension | generateContent (classic) | Interactions API (new) |
|---|---|---|
| Endpoint | POST /v1beta/models/{model}:generateContent | POST /v1beta2/interactions |
| Input structure | contents[].parts[] (role-based multimodal parts) | input (string or content blocks; model name in the body) |
| Output structure | candidates[0].content.parts[] | steps[] timeline: user_input / thought / function_call / function_result / model_output |
| Multi-turn | Client resends the full history every turn | previous_interaction_id continues server-side (stateless mode also possible) |
| Thinking | thoughtsTokenCount counter; image models’ interim thinking drafts come back mixed into image parts | Returned explicitly as steps (type: "thought"), including thought text and interim images |
| Streaming | Dedicated :streamGenerateContent endpoint | Same endpoint with "stream": true in the body |
| Background execution | Not supported | "background": true for long-running tasks |
| Caching | Explicit caching + implicit caching | No explicit caching; previous_interaction_id significantly improves implicit cache hit rates |
| Server-side data retention | Requests not stored | store: true by default: 55 days on the paid tier, 1 day on the free tier, deletable; store: false opts out (but is incompatible with background and previous_interaction_id) |
| Usage fields | promptTokenCount / candidatesTokenCount / thoughtsTokenCount / totalTokenCount | total_thought_tokens / total_output_tokens etc. (snake_case) |
| Agent calls | Not supported | Same interface calls official agents such as Deep Research and Antigravity |
| Not yet available | — (most complete feature set) | Batch API, explicit caching, video_metadata, automatic function calling (Python), remote MCP on Gemini 3 |
| SDK entry point | client.models.generate_content (google-genai) | client.interactions.create (google-genai ≥ 2.3.0 / @google/genai ≥ 2.3.0) |
A common pitfall with the Interactions API’s server-side state:
previous_interaction_id only carries over the conversation history. tools, system_instruction, and generation_config (including thinking_level, temperature, etc.) are interaction-scoped — you must re-send them on every turn or they silently stop applying.Request & Response Structures (single text turn)
The generateContent example works directly against the APIYI gateway; the Interactions API example targets Google’s endpoint directly (not yet supported by APIYI):Multi-turn Conversations Compared
This is where the two paradigms feel most different. generateContent requires resending the entire history every turn; the Interactions API only needs the previous turn’sid:
store semantics.
Differences for Image Models
Gemini 3 image models (such asgemini-3-pro-image) think by default, and the two paradigms present the “interim thinking drafts” completely differently:
- generateContent (APIYI’s current gateway format): interim thinking drafts come back as ordinary image parts inside
candidates[0].content.parts(withthoughtSignature, without athoughtflag). In testing a single response can contain 2–10 images, each billed at 1120/2000 tokens into the output — always iterate over parts and take the last one as the final version. Full measurements and reconciliation rules: Usage Fields & Output Explained. - Interactions API: thinking is made explicit as
type: "thought"steps (thought text and interim images), with the final image in themodel_outputstep; the SDKs also provide.output_image/.output_textconvenience properties. Interleaved text-and-image output (e.g. illustrated stories) still requires manually iterating over steps.
APIYI Gateway Compatibility Test
Probed againstapi.apiyi.com with a test key on July 4, 2026 (UTC+8):
| Test | Request | Result |
|---|---|---|
POST /v1beta2/interactions + Bearer auth | minimal gemini-2.5-flash request | ❌ 404 (Invalid URL) |
POST /v1beta/interactions + Bearer auth | same | ❌ 404 (Invalid URL) |
POST /v1beta2/interactions + x-goog-api-key auth | same | ❌ 404 (Invalid URL) |
POST /v1beta/models/{model}:generateContent | text/image models | ✅ Works (all Gemini docs on this site are based on it) |
Recommendations
- Via APIYI: keep using generateContent. It has the most complete feature set (Batch, explicit caching, and video_metadata are in fact generateContent-only), and Google has committed to fully supporting it — there is no near-term deprecation risk.
- Multi-turn with generateContent: assemble the history client-side; see Gemini Native Format and Multi-turn Conversations.
- If you call Google directly and consider migrating to the Interactions API, watch four things:
tools/system_instruction/generation_configmust be re-sent every turn;storedefaults to on with 55-day retention on the paid tier; Batch API and explicit caching are not yet available; upgrade google-genai / @google/genai to 2.3.0+. - When the Interactions API becomes worth watching: when you need official agents (Deep Research, Antigravity),
background: truelong-running tasks, or want server-side state to cut multi-turn token costs. We will update this page as soon as APIYI adds support.
Related Docs
Gemini Native Format
The complete guide to the generateContent native format via APIYI
Gemini Response Handling
Parsing candidates, parts, and finishReason correctly
Usage Fields & Output Explained
Image-model usageMetadata semantics and measured thinking-draft behavior
Multi-turn Conversations
Implementing multi-turn chat on a stateless interface