Developer workflow · Practical guide
Gemini system_input: change the rule without rewriting the prefix
Google’s Interactions API preview lets developers append system and function-tool updates mid-conversation. Check cache usage before estimating the cost.
Put the late change after the stable prefix
On December 3, Google announced public preview of mid-conversation instructions in the Gemini Interactions API. If a support agent switches from lookup to review halfway through a long session, the application can now append that mode change as a system_input step. It no longer needs to edit the original system instruction just to describe what changed.
In the documented stateful flow, pass the preceding turn’s ID in previous_interaction_id and keep the top-level settings unchanged. Place one system_input immediately before user_input. The update joins the conversation history, so Google says it remains active alongside the original instructions on later turns. The release notes name Carbon, Neon and Hydrogen on v1beta; this guide does not assume the same behavior on GenerateContent or Live.
What belongs in each part of the request?
Scroll sideways to read all columns.
| Part | What to put there | What to check |
|---|---|---|
| Stable prefix | Same top-level system instruction and tool declarations | Resend the same top-level configuration |
| Current system_input | App-owned rule change or function-tool delta | One update step just before user_input |
| Current user_input | The user’s new message | Do not elevate user text into system_input |
Keep tool visibility separate from permission
A system_input can also contain added_tools and removed_tools for function tools. The preview does not support these updates for MCP server tools. In a hypothetical review-only support flow, removing the edit function tells the model which actions are available now. The application must still check whether an action is allowed before executing any proposed call, including one queued before the change.
Keep the update text under application control. A user who asks to switch modes has made a request, not changed the rules. Let the backend decide whether the transition is allowed and generate the system_input from that decision; send the user’s text in user_input.
Measure cached input before budgeting the next turn
Google says there is no separate fee for the feature. New instruction tokens are ordinary input; prior tokens stay eligible for cached pricing. Eligible does not mean cached on every request. The caching guide lists a 4,096-token floor for Gemini 4 Neon and says implicit caching is opportunistic. A short chain or an earlier change to the prefix can leave fewer tokens eligible or actually reused.
For a hypothetical Neon Standard turn with 12,000 total input tokens and 9,000 reported as cached, the input subtotal is 3,000 × $3.00 plus 9,000 × $0.15, each divided by one million: $0.01035 USD. With zero cached tokens and the same total, it would be $0.036 USD. These December 4 list rates and assumed counts illustrate input billing only; output and external tool charges are not included.
To check your own workload, compare usage.total_input_tokens and usage.total_cached_tokens on ordinary and update turns while keeping the model and top-level configuration fixed. Record what the application allowed separately from what the model proposed. A turn can follow the new rule and still miss the cache, or get a cache hit and still propose an action the backend must reject.
Sources & verification
Provider documentation supports the facts referenced below. Our explanations and recommendations are editorial interpretation.
- Google: Introducing mid-conversation instructions in the Gemini API ↗Checked Dec 4, 2026
- Gemini API release notes: December 3, 2026 ↗Checked Dec 4, 2026
- Gemini API: Context caching ↗Checked Dec 4, 2026
- Gemini API pricing: Gemini 4 Neon ↗Checked Dec 4, 2026
Corrections: hello@aiapicost.com