Coding with AI

Gemini API Adds File Slicing for Targeted Reads

Gemini's new file slicing lets developers select pages, cells and media segments. See the limits and a worksheet for deciding when a second pass helps.

A blank glass sheet separated from a stack of blank sheets under blue and mint studio light.

Google announced file slicing controls for the Gemini API on November 23, 2026. Developers using Gemini 4 models can ask the API to inspect selected document pages, spreadsheet cells, or audio and video segments instead of loading every part of an uploaded file into a request. Google says billing counts the parts inspected. The practical decision is whether a narrower first pass still gives your application enough context to answer correctly. The announcement describes an API feature in Google AI Studio and the Gemini platform; it does not establish the same control in the consumer Gemini app.

What changed on November 23

Google’s launch post says an application can upload a file once through the Files API, reuse its URI, and choose different parts to inspect across turns. The request can specify document page ranges and text or image layers, worksheet tabs and cell ranges, and time intervals in audio or video. The announcement also adds native upload support for Microsoft Office and OpenDocument files. Google describes the new controls as server-side processing, reducing the need for a client application to render and cut up files itself.

The distinction matters for existing pipelines. Sending a 100-page PDF and asking a model to “look at page 10” in the prompt is not the same as setting a page range in the file’s processing options. The latter tells the API which page content to send to the model. Google’s document guide says it counts and bills only the selected slice when those options are set. Without them, document processing defaults to page images. For a workbook, the documented default includes values, formulas, and sheet names across tabs. Check the request body, not just the wording of the prompt.

A narrow slice can omit required evidence: a table may need footnotes, and a chart may need surrounding explanation. Test answer completeness on your own documents.

Choose the slice that matches the question

The document-processing options name page and spreadsheet selectors. Google’s launch post describes media interval controls.

Input and task Selection to verify Context the slice could omit
PDF or slide deck: read a known section start_page and end_page; page_text for extractable text or page_image for layout A definition, caption, or footnote on another page
PDF: inspect a chart after locating it First skim extracted text, then request the chart page as page_image at the resolution needed A chart legend or notes outside the chosen page
Spreadsheet: audit a named range sheet_index, visible_cells, and the data, formulas, or visual layers needed Dependencies in another sheet or cells outside the range
Audio or video: inspect a known moment start_offset and end_offset; for video, choose the needed transcript, frames, or audio layer Earlier context, a speaker change, or a visual outside the interval

For pages, the guide says start_page and end_page are one-indexed and inclusive. Pages 3 through 7 therefore select five pages. Page zero is invalid. A start beyond the file’s end yields an empty slice, while an end beyond it clamps to the last page. Those details are worth validating in application code before passing model output to a user. The spreadsheet guide similarly counts sheet_index from one and expresses visible_cells in A1 notation, such as A1:H50.

Extracted page text may locate a section, but a chart or unusual layout can require page_image. In spreadsheets, evaluated data, raw formulas, and visual answer different questions. Widen the read when a slice omits evidence.

Work out whether skim, then detail helps

Google’s example skims a document as extracted text, then reuses its file URI to inspect one page at high resolution. That is a sensible pattern to evaluate when the relevant page is unknown at first. It is not a promise that two calls are cheaper or more accurate than one. The first call consumes input, output, and potentially thinking tokens. The second consumes its selected pages plus any repeated instructions and context. See Google’s example and the token-counting guide.

Make one row for each completed call. For a single whole-file request, record whole input + whole output + whole thinking. For the two-pass route, record skim input + skim output + skim thinking + detail input + detail output + detail thinking. Keep cached-token and tool-use fields as the API reports them; do not add them twice. Our Gemini token-counting worksheet explains why a preflight input count and the final response usage are different records.

Worksheet field Whole file Skim, then detail
File content sent to model All processed pages or cells Skim layer, then selected detailed pages or cells
Repeated prompt, instructions and history Count once for the request Count for each request that sends them
Output and thinking Record from one response Add the two responses separately
Answer completeness Test against the required evidence Check whether the skim found the right slice and the detail retained context

The document guide gives approximate Gemini 4 page-image budgets of 280 tokens per page at low resolution, 560 at medium, and 1,120 at high. As an illustration of the page-image component only, 100 pages at medium resolution would be about 100 × 560 = 56,000 image tokens; five high-resolution pages would be about 5 × 1,120 = 5,600. The second route still needs the skim, prompts, responses, and any extracted text. It might need more pages after inspection. The difference between those two image figures is not a measured token saving or a dollar saving for a real workload.

Run both approaches on representative files and log final usage for the same model and API route. Check answer completeness before comparing bills. The API cost calculator can apply current rates to actual token counts; it cannot measure answer quality. Our document parsing cost guide covers other routes with different billing units.

Limits still apply to the complete upload

Slicing changes what the model inspects, not what the upload endpoint accepts. Google’s limits table states that these caps apply to the full file, including when a request selects a small part:

Uploaded file Documented cap
Supported document, presentation, or spreadsheet 50 MB per file
PDF 1,000 pages
Office or OpenDocument document or presentation 2,000 pages or slides
Spreadsheet 50,000 cells per sheet

Before changing a pipeline, check size and length, validate ranges, and keep a full-document fallback. Compare outputs on files with known answers, including an answer spanning a range boundary. Record ranges, layers, resolution, model, usage, and retries. No accuracy result for your files follows from Google’s limits.

The AI model tracker gives release context; choose the model and the file slice separately.

Sources

All pages read on November 26, 2026.

Free toolWhat will 10,000 chats a month cost?Estimate my bill
DailyTech Editorial Team

We explain AI with numbers you can check. Every price, limit and benchmark links to its source and the date we read it. How we work · Report an error