Summary:

Gemini API file slicing lets developers select pages, spreadsheet cells, or media clips. See what counts toward tokens and which upload limits still apply.

Google’s Gemini API can now inspect a few pages from a PDF, a range of cells from a workbook, or a short clip from a recording without loading the whole file into the model’s context. You can upload the full file once and reuse its Files API URI for different slices. Google put the controls in its November 18 changelog and published a launch guide on November 23.

What you can select

  • PDFs, documents, and slides: Choose a page range, extracted text, images of the pages, or both. Page numbers start at 1, and both ends of a range are included.
  • Spreadsheets: Pick a worksheet by its position and a range like B6:G24. Ask for evaluated values, formulas, or a rendered view when layout or charts matter.
  • Audio and video: Set a start and end time. For video, you can also choose the frame rate and whether the model receives frames, audio, or a transcript.

Google’s launch covers the Gemini 4 family, and the API now accepts supported Microsoft Office and OpenDocument files directly. The same controls can be used when an app returns a file from a tool call, not just when a person supplies a file in a prompt.

What slicing saves, and what it doesn’t

Google bills the model-input tokens for the content it processes from the slice. For example, at Google’s estimate of 560 tokens per medium-resolution page image, five pages would contribute around 2,800 image tokens instead of 56,000 for 100 pages at the same resolution. That compares page images only, not the rest of the input or the model’s output. The size and page limits still apply to the full uploaded file.

For a spreadsheet assistant, a useful first request might look at the values in B6:G24 on the second worksheet. If the answer depends on how a total was calculated, the next request can use the same file URI and ask for the formulas in those cells. If the formula refers to a different tab, request that section separately rather than assuming the original slice included it.

Sources