Gemini API: mid-conversation system_input

Change instructions and tools between messages while the prompt cache stays valid.

How to try it

  1. Use the Interactions API on the v1beta endpoint with any Gemini 4 model.
  2. On every turn, send the same `system_instruction` and `tools`, plus `previous_interaction_id`.
  3. Before the `user_input` step, add a `system_input` with text and/or `added_tools`/`removed_tools`.
  4. Verify the order of changes via `interactions.get`.

Price: no extra charge, system_input is billed as regular input

Official link

More new tools