Gemini API adds server-side file slicing
Google's Gemini API can now slice PDFs, Office files, spreadsheets, audio and video on its own servers, so agents can pull in only the pages, cells or clips they need and pay only for those tokens.
Google announced file slicing controls for the Gemini API in Google AI Studio and on the Gemini platform. The API can also now take Microsoft Office and OpenDocument files directly. Developers can pass PDFs, documents, slides, spreadsheets, audio and video to the API and ask for only certain pages, spreadsheet cells, media segments or content layers. Google says tokens are billed only for the parts Gemini inspects.
The controls work on all Gemini 4 models. Existing file size and page limits still apply.
- Documents and slides: choose a page range, a resolution (low, medium or high), and whether to send page text, page images or both.
- Spreadsheets (.xlsx, .xls, .ods): choose a worksheet tab and a cell range, a resolution, and whether to include data, formulas and visuals.
- Video: choose a time range, frame rate and resolution, plus transcript, frames or audio.
- Audio: choose a time range.
If no options are set, documents are sent as page images that keep the layout, and spreadsheets include evaluated values, formulas and sheet names for every tab.
The change is aimed at agent builders. A file uploaded once through the Files API can be reused across turns, and an agent can request specific slices from inside a function response. Google suggests skimming cheaply first, using extracted text or low-resolution previews, and then requesting high resolution only for the pages that matter. Its example skims a Word document as text and then reads one page as a high-resolution image.
Google argues this removes the need to run LibreOffice, PDF renderers or ffmpeg inside client harnesses. It says gateway and SDK partners tested the controls before launch and cut prompt token spend. The source excerpt ends before naming those partners or giving figures.