Gemini API adds file slicing: send the model only the pages, cells or clips it needs
Google's Gemini API now lets developers pick which pages, spreadsheet ranges or video segments a model reads from an uploaded file, and accepts Office and OpenDocument files directly. You pay only for what is inspected.
- Author
Umair Mateen- Published
- Reading time
- 4 min
- Category
- AI
Ideas in this post
Tap one for a 5-second answer. Underlined words in the article work the same way.
0 of 2 understood

Google announced file slicing controls for the Gemini on 23 November 2026. Developers can now tell the model exactly which part of an uploaded file to read, such as pages 4 to 9 of a PDF, one range of cells in a spreadsheet, or two minutes of a video, instead of sending the whole thing. The API also now accepts Microsoft Office and OpenDocument files directly.
What it actually does
Many business AI features start with a file: a contract, a monthly workbook, a recorded call. Until now, the simplest path was to hand the whole file to the model and let it find what mattered. That works, but you pay for every page and frame, and long files leave more room for the model to latch onto the wrong part.
With file slicing, the selection happens on Google's side before the model reads anything. The options depend on the file type:
Quick check · Everyday ↔ real
The restaurant and the API, side by side
Switch between the two and see how each part lines up.
- You, the customer
- The menu
- Your order to the waiter
- The kitchen
- Your dish, or "sold out"
You order from the menu and the waiter brings back your dish, without you ever seeing the kitchen.
| Everyday | Real |
|---|---|
| You, the customer | The client (your app) |
| The menu | The documentation |
| Your order to the waiter | The request |
| The kitchen | The server |
| Your dish, or "sold out" | The response, or an error |
From the explainer What is an API? Explained with a waiter in a restaurant
- Documents and slides (PDF, Office, OpenDocument): choose a start and end page, a resolution (low, medium or high), and whether the model sees the page text, the page image, or both.
- Spreadsheets (.xlsx, .xls, .ods): choose a sheet, a visible cell range, a resolution, and whether to include values, formulas or visuals such as charts.
- Video: choose start and end times, frame rate and resolution, and whether to use the transcript, the frames, the audio or a mix.
- Audio: choose start and end times.
If you set nothing, documents are read as page images that keep their layout, and spreadsheets include values, formulas and sheet names across every tab.
Who should care
Any team that feeds files into Gemini at volume: invoice and contract processing, finance teams asking questions of large workbooks, support teams summarising call recordings, or agents that read reports on a schedule. The native Office support matters too. If your app currently converts Word or Excel files to PDF or text before sending them, that step may no longer be needed.
Cost and what Google's partners report
Google says billing covers only the tokens the model actually inspects, so a narrower slice is a cheaper request. The announcement does not list per-token prices.
The post includes figures reported by two partners in their own testing. Vercel said skimming a PDF's extracted text used 14 times fewer tokens than rendering the full document. LiteLLM reported prompt-token cuts of 67% on a PDF and 33% on a workbook. These are vendor results on their own files, not guarantees, and your savings will depend on how much of each file you can safely skip.
Limits and caveats
- Availability: live now through the API in Google AI Studio and on Google's enterprise Gemini platform (Vertex AI), across all Gemini 4 models.
- Existing limits stay: the usual file size and page limits still apply; slicing does not let you upload bigger files.
- You decide what is skipped: if your code slices out the page with the termination clause or the tab with the real totals, the model will not see it. Slicing saves money only when you know where the answer lives, or when a cheap first pass (text only, low resolution) tells you where to look.
- Text versus image: reading page text alone is cheaper but can lose tables, stamps, signatures and layout. Test both on your real documents.
What to do this week
- List the places your product sends whole files to Gemini, and note which ones only ever need a known part (a cover page, one tab, the first minutes of a call).
- For those, run a side-by-side test on a sample of real files: full file versus sliced, comparing cost, speed and answer accuracy.
- Try a two-step pattern for long documents: a low-cost text-only pass to find the relevant pages, then a high-resolution read of just those pages.
- If you convert Office files before upload, test sending them directly and drop the conversion step if results hold up.
The DevDrift helps teams build document workflows on AI models with review steps and .
Sources
You’ve read the news. Now understand it.
- Learn · 5 min · Everyday ↔ realWhat is an API? Explained with a waiter in a restaurantAn API is a set of rules that lets one program ask another for data or a task and get an answer back. Explained with a waiter carrying orders between you and the kitchen.Start in 5 seconds →
- Learn · 5 min · Myth or factWhat is an audit trail? Explained with a visitor logbookAn audit trail is a time-ordered record of who did what in a system, when and with what result. Explained with the visitor logbook at an office reception desk.Start in 5 seconds →


