Google announced file-slicing controls for the Gemini API on November 23, letting developers select which pages, spreadsheet cells or media segments the model inspects on Google's servers. The company says token charges for those files cover only the portions Gemini inspects. A chart lookup doesn't have to become a cover-to-cover reading assignment. Source
Google says the controls are available across all Gemini 4 models through Google AI Studio and the Gemini platform, alongside native Microsoft Office and OpenDocument uploads. Existing file-size and page limits still apply to the uploaded file. Source
Upload once, choose what gets read
Developers can upload a supported file through the Files API, then reuse its reference across conversation turns and tool calls. Uploading and inspecting are separate steps: the file goes up, but developers or agents can specify which portions Gemini loads into context. Agents can also specify those portions in a tool's reply (a function response) during a multi-step task. Source
Google lists different controls for each kind of file: Source
- Documents and slides: Choose page ranges, resolution, and extracted text or page images.
- Spreadsheets: Choose a worksheet and cell range, with options for data, formulas and visuals.
- Video: Choose time intervals, frame rate, resolution, and transcript, frame or audio layers.
- Audio: Choose time intervals to inspect.
Google's example uploads a Word report, skims its pages as extracted text to locate a revenue chart, and then inspects that page at high resolution using the same file reference. No need to give every page the deluxe treatment. Source
Google also says server-side slicing and rendering can replace preparation work that developers might otherwise handle locally with LibreOffice, PDF renderers or ffmpeg. That's less file-preparation machinery for an agent's developer to babysit. Source
Smaller inputs, not a universal savings percentage
In its announcement, Google quotes Vercel saying that skimming a document page as text used “14x fewer tokens” than rendering the whole PDF. It also quotes LiteLLM reporting 67% fewer prompt tokens for a PDF and 33% fewer for a workbook in its testing. The announcement includes no detailed test methodology or independent validation; these examples don't establish typical savings on a full API bill.
Comments