# Gemini API file slicing: pay only for the pages Gemini reads

> Since 2026-11-23 the Gemini API can read a chosen page range, cell range or media clip of an uploaded file, bills only those tokens, and accepts Office files.

- Published: 2026-11-24
- Publisher: Rig Labs (https://riglabs.ai/)
- Canonical: https://riglabs.ai/blog/gemini-api-file-slicing/
- Answers: Gemini API file slicing
- Agent file (a short card for your agent): https://riglabs.ai/blog/gemini-api-file-slicing/AGENT.md

---

Gemini API file slicing, released by Google on November 23, 2026, lets a developer upload a file once and have Gemini read only the pages, spreadsheet cells or media segments they name. Google bills tokens only for the parts Gemini inspects, and the API now accepts Microsoft Office and OpenDocument files directly.

What you can now do: if your app or agent sends long PDFs, slide decks, workbooks or recordings to Gemini, you can stop paying for the whole file on every question. Ask for page 3 only, or minutes 10 to 12 only, and reuse the same upload for the next question.

## What is file slicing in the Gemini API?

File slicing in the Gemini API is a set of options on each request that choose which part of a file the model sees, per [Google's announcement](https://blog.google/innovation-and-ai/technology/developers-tools/file-slicing-controls/). You upload the file once with the Files API and reuse its address (its URI) across turns and tool calls. Google says it works on all Gemini 4 models, in Google AI Studio and the Gemini platform, and that existing file size and page limits still apply.

Google's description of the old way: agents ended up running LibreOffice, PDF renderers and ffmpeg on their own machine to cut large files. Now the API slices and renders the file on Google's side.

## What can you slice?

The Gemini API slices four kinds of file, per the announcement:

| File | What you choose |
|---|---|
| Documents and slides (PDF, Office, OpenDocument) | A page range, a resolution (low, medium, high), and layers: page text or page image |
| Spreadsheets (.xlsx, .xls, .ods) | A worksheet, a cell range, a resolution, and layers: data, formulas, visuals |
| Video | A time interval, frames per second, a resolution (low, high), and layers: transcript, frames, audio |
| Audio | A time interval |

If you set nothing, documents and slides default to page images that keep the layout, and spreadsheets include values, formulas and sheet names across all tabs.

## How much does file slicing save?

File slicing saves the tokens of every part Gemini does not read, and the size of the saving depends on your files. Rohan Doshi of Google DeepMind, a co-author of the announcement, [reported on X](https://x.com/RohanLikesAI/status/2124928403522408626) an early result: Vercel used 14 times fewer tokens skimming a page as text than rendering the full PDF. That is the partner's number as Google relays it. This changes your bill only if you pay for the Gemini API by the token. It changes nothing in the Gemini app.

## How do agents use it?

An agent can name the slice it wants inside a function result, per the announcement, so it decides mid-task which page to open. Google's suggested pattern is "skim cheap, then zoom in": read the whole document as extracted text first, then spend high-resolution tokens on the one page with the chart. Google's example does the skim on Gemini 4 Hydrogen and the close read on Gemini 4 Neon.

## What to do today

Find the one call in your code that sends a whole document to Gemini, and add a page range to it. This fragment is from Google's own example, which reads page 3 of an uploaded Word file as a high-resolution image:

```python
"resolution": "high",
"processing": {
    "type": "static",
    "page_options": {
        "start_page": 3,
        "end_page": 3,
        "content_layers": ["page_image"],
    },
},
```

Compare the prompt tokens of that call before and after.

Last checked 2026-11-24.

Sources:
- [Google: Introducing file slicing controls in the Gemini API, 2026-11-23](https://blog.google/innovation-and-ai/technology/developers-tools/file-slicing-controls/)
- [Rohan Doshi on X, 2026-11-23](https://x.com/RohanLikesAI/status/2124928403522408626)
- [Logan Kilpatrick on X, 2026-11-23](https://x.com/OfficialLoganK/status/2124938672399384681)
