Gemini API gains file slicing and now bills only for the slice used

Google announced on Monday (11/23) native file slicing controls for the Gemini API: developers can now send PDFs, Microsoft Office files, audio and video directly to the API and ask the model to process only the needed slice — a few pages, a range of spreadsheet cells or a few seconds of a video. Tokens are billed only for the content Gemini actually inspects.

Upload once, slice many times

The flow starts with a file upload through the Files API. From then on, the same URI can be reused across conversation turns and tool calls — without re-uploading the file. The agent itself can specify what to inspect inside a function response (function_result), making multi-step workflows faster and cheaper.

The controls vary by file type: in documents and presentations (PDF, Office and OpenDocument), developers can choose the page range, the resolution (low, medium or high) and the content layer (extracted text or page image); in spreadsheets (.xlsx, .xls and .ods), the worksheet tab, the cell range and the layers (data, formulas and visuals); in video, the time intervals, frame rate and layers (transcript, frames or audio); in audio, the time intervals.

What changes in practice

Until now, working with dense files meant converting everything to plain text or loading the whole file — or running LibreOffice, PDF renderers and ffmpeg on the client to slice the material before sending it. With server-side processing, Google promises to remove that step and keep the context focused only on the relevant slice.

The feature works across all Gemini 4 models, and the document, presentation and spreadsheet controls also apply to Gemini 3. Upload limits have not changed: 50 MB per file, 1,000 pages per PDF, 2,000 pages or slides per Office/OpenDocument file and 50,000 cells per spreadsheet sheet. Files uploaded through the Files API are stored for 48 hours.

Early partners testing the feature report direct savings: according to Vercel, extracting the text of a document page used 14x fewer tokens than rendering the whole PDF; according to LiteLLM, slicing cut prompt tokens by 67% for a PDF and 33% for a workbook. The controls are already available in Google AI Studio and the Gemini platform — and the API changelog already listed the feature before the official blog announcement on 11/23.

Image: Google Gemini icon, Google, via Wikimedia Commons.

Sources

Transparency note: this article was produced with the assistance of artificial intelligence, cross-checked against public posts on X and internet sources, and reviewed before publication. Please consult the original sources to confirm the information.

By Muse