Introducing file slicing controls in the Gemini API
New file slicing controls and native Office file support in the Gemini API let agents inspect targeted slices across Google AI Studio and Vertex AI while paying only for…
Google has unveiled new file slicing controls within its Gemini API, now accessible through Google AI Studio and the Gemini platform. This feature enables users to pass files such as PDFs, Microsoft Office documents, audio, and video directly to the API, with the option to request specific pages, spreadsheet cells, media segments, and layers. The API processes only the requested areas, thereby limiting token usage to the pertinent parts of the file.
The server-side slicing allows users to avoid flattening files into plain text or ingesting entire files at once. Users can now slice documents, spreadsheets, and videos by range, layer, resolution, and frame rate to efficiently manage token usage. Previously, models ingesting whole files required additional rendering and slicing tools, leading to memory bloat, cluttered local disks, and the need for per-user sandboxes in enterprise platforms.
The Gemini API now handles file slicing, rendering, and tokenization server-side when a Files API URI is provided in a user turn or within a function response. This functionality is available across all Gemini 4 models. Existing file size and page limits apply to the uploaded file. For media processing, users can customize options: documents and slides default to layout-preserving page images, while spreadsheets include evaluated values, formulas, and sheet names across all tabs.
Before the launch, gateway and SDK partners validated these controls, demonstrating their effectiveness in reducing prompt token spend within production systems. Native file slicing, content-layer controls, and expanded file support are now available via the API in Google AI Studio and the Gemini platform. Developers can explore the documentation to begin implementing these features.
Rewritten by urgent.news; may contain errors — check the original.
Source: blog.google