Say you need three pages of delivery terms from a 60-page PDF. An app could cut them out in advance or ask the model to read the whole thing. As of November 23, the app can specify those pages in a Gemini API request. Google loads only the selected pages into the model and counts those pages toward the file input.
The feature is called file slicing. It also works with presentations, spreadsheets, video, and audio. Google added native support for Microsoft Office and OpenDocument files at the same time. An app can now submit a Word document or an Excel workbook without converting it to PDF or plain text first.
Upload the file once and use it in several requests
The app uploads a file through the Files API and gets back an address, or URI. It can use that URI in several calls to the Interactions API. The first call might read the delivery terms. The next one could open the page with the rates. The app can reuse the uploaded file without transferring all its bytes again for the second request.
Google slices the file on its servers. If you upload the whole PDF, Google receives it even when the model only reads some of it. If other pages need to stay on your device, extract the pages you want first and upload the smaller file. Keep your original for later use. The Files API deletes uploaded copies after 48 hours.
What you can select in each kind of file
Documents use page numbers. Spreadsheets use a worksheet and a range of cells. For audio and video, you select a time interval. In video, you can also choose what kind of data from that interval the model receives.
| File | What you can give the model |
|---|---|
| PDF, Word, PowerPoint, OpenDocument | Pages or slides. Extracted text, page images, or both |
| .xlsx, .xls, or .ods spreadsheet | A tab and a range such as B4:G25. Cell values, formulas, and a visual snapshot |
| Video | A time interval. Frames, audio, or a transcript, with control over the frame sampling rate |
| Audio | A clip between two timestamps |
The first and last pages are both included, and numbering starts at one. These settings select pages 14 through 16. Put processing inside the request’s document block alongside the file URI. The model receives images of those three pages.
{
"processing": {
"type": "static",
"page_options": {
"start_page": 14,
"end_page": 16,
"content_layers": ["page_image"]
}
}
}
The API counts the page’s position in the file. A page number printed at the bottom can differ if the PDF begins with a cover and contents page, as many manuals do. For a new document, check the page number in your PDF viewer’s navigation before using it in a request.
For a spreadsheet, sheet_index also starts at one. It refers to the tab’s position in the workbook. The second tab has index 2. The visible_cells option narrows down what to read on it. If people rearrange the tabs in a shared template, check their order before making the request. The same index could point to a different sheet after an edit.
Choose which parts of the cells the model needs. To read the amount in a total row, the evaluated values are enough. To explain where the total comes from, the model needs the formula and may need to see the cells it refers to. If those cells fall outside the selected range, include them in the request.
When text is enough and when you need the page
Sometimes the first job is finding a page in a report. Extracted text may be enough to locate the section on expenses. The app can then use the same file URI and request an image of the page with the chart. That gives Gemini the axis labels, notes, and relative positions of the bars. For a short answer based on prose alone, the page_text layer may be enough.
Old PDFs sometimes contain pages stored as scanned images. If the extracted text is missing part of the document, try the page image. Images also help with completed forms where you need to see which row a checkbox belongs to. With these files, try the cheaper text layer on a few pages before relying on it.
The same choice comes up with video. To find out what a presenter said between minute twelve and minute thirteen, request the transcript for that interval. To read a diagram the presenter put on screen, include frames. A higher frame sampling rate captures more of what changes on screen and puts more visual data into the request.
How many tokens could you save?
The API measures the input and output it processes in tokens. Google estimates about 560 tokens for a page image at medium resolution. In the 60-page example, that works out to about 33,600 tokens for the whole PDF or 1,680 for the three selected pages. The numbers here cover the images. The text of the prompt, any other attachments, and the answer also affect total usage.
Higher resolution uses more tokens for each page. That can be worthwhile for small print or a dense table. For a recurring job such as reading the same fields from invoices, you can compare usage on one file first. The Interactions API returns usage data so you can measure the difference on your own documents.
Keep the model, prompt, and resolution the same when comparing two requests. That isolates the savings from narrowing the range. Changing the model and how it reads the file at once makes the numbers harder to explain. If your app first uses text to find the right section and then requests a page image, count both calls in the total.
The original file still has to fit the limits
Google lists a limit of 50 MB per document, 1,000 pages per PDF, and 2,000 pages or slides per Office or OpenDocument file. The spreadsheet limit is 50,000 cells per sheet. The service applies the slice after upload, so the file still has to fit the limits for its format.
Google says slicing works across the Gemini 4 family, including Gemini 4 Hydrogen. The right range depends on the question. If the answer turns on a note on the next page, include it. For files that follow the same template, the app can go straight to the right range. In an unfamiliar report, it can start by locating the right section in the text and then take a closer look.

Join the conversation
Stay on topic and respect other readers. Your first comment may appear after editorial review.