Gemini API File Slicing: Read Only the Part of a File You Need Google announced file slicing controls for the Gemini API on 23 Nov 2026, letting developers send only selected pages, sheets or content layers of a document and pay tokens only for the parts Gemini inspects, according to the Gemini API changelog entry dated 18 Nov 2026. Developers enable slicing by setting a `processing` object with `type` set to `static` on a document block, using `page_options` fields such as `start_page`, `end_page` and `content_layers`; the docs price a page image at about 280 tokens at low resolution, 560 at medium and 1,120 at high on Gemini 4 and Gemini 3 models, versus a flat 258 tokens per page on Gemini 2.5 models. Google's post says the feature removes the need for agents to run "LibreOffice, PDF renderers, and ffmpeg inside the client harness to render and slice large files. Gemini API File Slicing: Read Only the Part of a File You Need Add a processing object to a Gemini API document block to send only chosen pages, sheets or layers, and Gemini bills just that slice. Checked 1 Dec 2026. Gemini API file slicing lets you send part of a file, such as chosen pages, sheets and content layers, instead of the whole thing. Google says https://blog.google/innovation-and-ai/technology/developers-tools/file-slicing-controls/ it bills “tokens only for the parts Gemini inspects.” You turn it on with a processing object, type set to static , on a document block. Checked 1 Dec 2026. What is Gemini API file slicing? what-is-gemini-api-file-slicing It is a set of request fields that tell Gemini which part of a file to read. Google announced it in “ Introducing file slicing controls in the Gemini API https://blog.google/innovation-and-ai/technology/developers-tools/file-slicing-controls/ ” on 23 Nov 2026, with direct upload of Microsoft Office and OpenDocument files. The post says you can “request only the pages, spreadsheet cells, media segments, and layers you need.” The Gemini API changelog https://ai.google.dev/gemini-api/docs/changelog lists it on 18 Nov 2026 as “Multimodal file processing and slicing”, so you “only process and pay for the content you need.” The post says that when model APIs only take whole files, agents end up running “LibreOffice, PDF renderers, and ffmpeg inside the client harness to render and slice large files.” With slicing, the API does that work on Google’s side. The idea is simple: read only the part of a file you need. How do you slice pages of a PDF, Word file or deck? how-do-you-slice-pages-of-a-pdf-word-file-or-deck Set processing.page options on the document block. The document understanding docs https://ai.google.dev/gemini-api/docs/document-processing customize-document-processing , read 1 Dec 2026, list these options, all optional: - start page and end page : the first and last page to include, counted from 1, inclusive. - content layers : page image for rendered pages, page text for extracted text, or both. It defaults to page image when processing is set. - resolution : set on the outer document block to low , medium the default or high . This is the docs’ Python example. It sends pages 3 through 7 of a PDF, five pages, as page images at high resolution: python from google import genai client = genai.Client uploaded doc = client.files.upload file="quarterly report.pdf" interaction = client.interactions.create model="gemini-4-hydrogen", input= { "type": "document", "uri": uploaded doc.uri, "mime type": "application/pdf", "resolution": "high", "processing": { "type": "static", "page options": { "start page": 3, "end page": 7, "content layers": "page image" , }, }, }, { "type": "text", "text": "Summarize the revenue bridge chart and footnotes on pages 3 through 7.", }, , print interaction.output text What does each page cost in tokens? what-does-each-page-cost-in-tokens On Gemini 4 and Gemini 3 models, the docs put a page image at about 280 tokens at low resolution, 560 at medium or 1,120 at high. Gemini 2.5 models use a “Flat 258 tokens per page.” The docs’ tip: “scan with page text first. Then request page image at high resolution only for pages with charts or dense layouts.” Google’s post calls this “Skim cheap, then zoom in.” How do you slice a spreadsheet? how-do-you-slice-a-spreadsheet Set processing.spreadsheet options . The docs list sheet index for the worksheet position in tab order, visible cells for a cell or range in A1 notation such as A1:G40, and content layers : data for evaluated values, formulas for raw formulas and visual for a rendered snapshot of charts and layout. The default layers are data and formulas . The docs’ Python example: python from google import genai client = genai.Client workbook = client.files.upload file="financial model.xlsx" interaction = client.interactions.create model="gemini-4-hydrogen", input= { "type": "document", "uri": workbook.uri, "mime type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "resolution": "high", "processing": { "type": "static", "spreadsheet options": { "sheet index": 2, "visible cells": "A1:H50", "content layers": "data", "formulas", "visual" , }, }, }, { "type": "text", "text": "Audit the EBITDA formulas and chart in Sheet 2 A1:H50 .", }, , print interaction.output text Can an agent pick the slice itself? can-an-agent-pick-the-slice-itself Yes: your tools can return a sliced file inside a function result block. The function calling docs https://ai.google.dev/gemini-api/docs/function-calling file-inspection-options say tools return “sliced pages, spreadsheet ranges, or media clips” with the same processing and resolution fields, and the model gets page counts and worksheet names “automatically so it can request narrower ranges on later turns.” The docs example wraps this in a tool named inspect document pages . Video works the same way: the video docs https://ai.google.dev/gemini-api/docs/video-understanding customize-video-processing list start offset , end offset , fps and content layers frames , audio or transcript . Google’s post gives audio the same clipping. How is a sliced file billed? how-is-a-sliced-file-billed Only for the part you send. The docs say “Gemini counts and bills tokens only for the slice you send.” Under Sliced billing they count only “the selected pages, sheets, and content layers sent to the model.” The pricing page https://ai.google.dev/gemini-api/docs/pricing , read 1 Dec 2026, has no line on slicing itself. It says “Tokens for the DOCUMENT modality for example, PDFs are billed at the image token rate.” On 1 Dec 2026 its Standard tab lists Gemini 4 Hydrogen https://munderdiffl.in/blog/gemini-4-hydrogen/ , the model in the docs examples, at $1.50 per 1M input tokens in USD on the paid tier. Which models and files does it support? which-models-and-files-does-it-support Gemini 3 and Gemini 4 models, per the docs; Google’s post says it “works across all Gemini 4 models.” Each cell below was read on 1 Dec 2026 from the page named. | Feature | What Google says | Status | Models | File types | Billing | |---|---|---|---|---|---| | page options | “Select a page range” post | “available today” post, 23 Nov 2026 | Gemini 3 and Gemini 4 docs | PDF, Office and OpenDocument documents and slides | Selected pages and layers only docs | | spreadsheet options | “Select a worksheet tab” post | “available today” post | Gemini 3 and Gemini 4 docs | .xlsx, .xls, .ods | Selected sheets and layers only docs | | Video clipping | “Clip time intervals” post | “available today” post | All Gemini 4 post | Video | Clipped interval and layers only video docs | | Office file input | “native file upload support” post | Changelog, 18 Nov 2026; no Preview label | Gemini 4, Gemini 3 and 2.5 docs | .docx, .doc, .dotx, .odt, .pptx, .ppt, .odp, .xlsx, .xls, .ods | Image token rate for DOCUMENT tokens pricing | Limits stay the same. The docs allow up to 50 MB per file, 1,000 pages per PDF, or 2,000 pages or slides per Office or OpenDocument file, and these apply “to the full uploaded file even when slicing.” Spreadsheets take up to 50,000 cells per sheet. Who gets the most from file slicing? who-gets-the-most-from-file-slicing We think slicing helps most when you write the agent code yourself, since it is a field in API requests. Munder Difflin https://harnessmd.com/download is free and open source: a desktop app that runs a team of AI agents for all kinds of knowledge work, coding included, on your own computer. Its README https://github.com/HarnessMD/munder-difflin , read 1 Dec 2026, lists Gemini CLI as an engine and says “Each agent picks its own, so one office can mix them.” It adds: “Each agent runs the real CLI you already use, signed in with your own plan.” Our what is Gemini CLI https://munderdiffl.in/blog/what-is-gemini-cli/ explainer covers that engine, how to install and use Munder Difflin https://munderdiffl.in/blog/how-to-install-and-use-munder-difflin/ covers setup, and more how tos sit in our Guides hub https://munderdiffl.in/blog/topics/guides/ . FAQ What is Gemini API file slicing? A way to send the Gemini API only part of a file: a page range, a worksheet tab, a cell range, a video clip or a content layer. Google announced it on 23 Nov 2026 and says it bills "tokens only for the parts Gemini inspects." How do I turn on file slicing? Add a processing object with type set to static on a document block, then set page options for PDFs, documents and slides, or spreadsheet options for workbooks. The docs, read 1 Dec 2026, say all these fields are optional. Which models support Gemini file slicing? The document understanding docs, read 1 Dec 2026, say Gemini 3 and Gemini 4 models support these options in user inputs and tool results. Google's post of 23 Nov 2026 says it works across all Gemini 4 models. Can I send Word, PowerPoint and Excel files to the Gemini API? Yes. The docs list .docx, .doc, .dotx, .odt, .pptx, .ppt, .odp, .xlsx, .xls and .ods. The limits are 50 MB per file and 2,000 pages or slides per Office or OpenDocument file, and they apply to the full uploaded file even when slicing. How is a sliced file billed? Only for what you send. The docs say "Gemini counts and bills tokens only for the slice you send." The pricing page, read 1 Dec 2026, says tokens for the DOCUMENT modality are billed at the image token rate.