Last updated: November 23, 2026
Gemini API file slicing, announced by Google on November 23, 2026, lets you load only the parts of a file you need: page ranges in PDFs and Office documents, worksheet tabs and cell ranges in spreadsheets, and time intervals in audio and video. The API also accepts Word, PowerPoint and Excel files directly, and bills only the slice.
Contents
- What is new
- Supported Office and OpenDocument formats
- Slicing options by file type
- How to slice a file step by step
- Token costs and limits
- Slicing inside function responses
- Frequently asked questions
What is new
Google’s announcement on the Keyword blog describes two changes. First, the Gemini API now has server-side file slicing controls in Google AI Studio and on the Gemini platform. Second, it accepts Microsoft Office and OpenDocument files natively, so you no longer need to convert a slide deck or workbook to PDF or plain text first. The Gemini API release notes list the feature under November 18, 2026 as “Multimodal file processing and slicing”.
Google frames the change around agents. When a model API only accepts whole files, agent harnesses often run LibreOffice, PDF renderers and ffmpeg locally to cut files down. With slicing, you upload a file once with the Files API, reuse its URI across turns, and ask for a different slice each time. Google suggests a “skim cheap, then zoom in” pattern: read extracted text or a transcript first, then spend high-resolution tokens only on the charts and frames that matter.
Two early partners quoted in the announcement reported savings. Vercel said skimming a document page as text used 14 times fewer tokens than rendering the whole PDF. LiteLLM said slicing cut prompt tokens by 67% for a PDF and 33% for a workbook in its testing.
Supported Office and OpenDocument formats
According to the document understanding guide, you pass these files inline or through the Files API using a document content block. When you omit processing options, Gemini 4 models handle them as follows.
| File type | Extensions | Default handling on Gemini 4+ |
|---|---|---|
| Documents | .docx, .doc, .dotx, .odt |
Page images at medium resolution (about 560 tokens per page) |
| Presentations | .pptx, .ppt, .odp |
Slide images at medium resolution (about 560 tokens per slide) |
| Spreadsheets | .xlsx, .xls, .ods |
All sheets: values, formulas and sheet names |
.pdf |
Page images, with embedded text extracted at no extra token charge |
Gemini 3 and 2.5 models read .docx and .pptx as extracted text plus embedded images, and .xlsx as CSV values only.
For the Gemini app rather than the API, see Can Gemini read PDFs?
Slicing options by file type
You set slicing with a processing object of {"type": "static", ...} on the content block. The available fields differ by media type, as described in the document, video and audio guides.
- PDFs, documents and slides:
page_optionswithstart_pageandend_page(1-indexed and inclusive) andcontent_layersof"page_image","page_text"or both. When you set processing, the default layer ispage_image. Setresolutiontolow,mediumorhighon the outer document block. - Spreadsheets:
spreadsheet_optionswithsheet_index(1-indexed tab position),visible_cellsin A1 notation such as"A1:G40", andcontent_layersof"data","formulas"and"visual". The default is data plus formulas;visualadds a rendered snapshot for charts and layout. - Video:
start_offsetandend_offsetas seconds strings such as"1200s", anfpsvalue above 0 and up to 24, andcontent_layersof"frames","audio"and"transcript". The default is frames plus audio. - Audio:
start_offsetandend_offset, for example"60s"to"150s".
Out-of-range values behave predictably. A start_page of 0 or less returns 400 INVALID_ARGUMENT, while an end_page past the last page is clamped. A start_offset past the end of an audio or video file also returns 400 INVALID_ARGUMENT.
How to slice a file step by step
The steps below follow Google’s skim-then-zoom example, which uses the Interactions API with the Python SDK. Our Gemini API CLI guide covers the gemini-api command-line tool if you prefer to upload from a terminal.
- Upload the file once. Call
client.files.upload(file="quarterly_report.docx")and keep the returned URI and MIME type. - Skim as text. Send a
documentblock with that URI and"processing": {"type": "static", "page_options": {"content_layers": ["page_text"]}}, then ask which page holds the content you need. - Zoom in on one page. Reuse the same URI with
"resolution": "high"andpage_optionsset to"start_page": 3, "end_page": 3and"content_layers": ["page_image"]. - For a workbook, pick the tab and range. Use
spreadsheet_optionssuch as"sheet_index": 2and"visible_cells": "A1:H50", and add"visual"only if a chart matters. - For long video, read the transcript first. Request
"content_layers": ["transcript"]to find timestamps, then send a clipped interval with"frames". - Check usage. Page image tokens appear under the
"image"modality inusage.input_tokens_by_modality, so you can confirm the slice reduced your input.
Token costs and limits
The technical details section sets out how slicing affects billing. When you set processing options, Gemini counts and bills only the selected pages, sheets and content layers. On Gemini 4 and Gemini 3 models, page images cost about 280 tokens per page at low resolution, 560 at medium and 1,120 at high. Gemini 2.5 models use a flat 258 tokens per page.
As a worked example using these documented rates, a 100-slide deck read in full at medium resolution is about 56,000 input tokens. Reading only slides 10 to 14 at high resolution is about 5,600 tokens. On Gemini 4 Hydrogen, priced at $1.50 per million input tokens in the release notes, that is roughly $0.084 versus $0.008 before output tokens.
Limits are unchanged by slicing and apply to the full uploaded file:
- 50 MB per file.
- 1,000 pages per PDF.
- 2,000 pages or slides per Office or OpenDocument file.
- 50,000 cells per sheet.
- Pages render as 2-megapixel images (288 DPI); input pixel size does not change token cost.
Slicing inside function responses
The function calling guide shows that your tools can return sliced pages, spreadsheet ranges or media clips inside a function_result block, using the same processing and resolution fields. The model automatically receives page counts and worksheet names, so it can ask for a narrower range on a later turn. For example, a tool named inspect_document_pages can take start_page and end_page arguments chosen by the model.
This pairs well with Gemini API tool retrieval, which loads tool schemas on demand, and with Gemini 4 Neon, which Google’s example uses for the high-resolution zoom step.
Frequently asked questions
What is file slicing in the Gemini API?
File slicing lets you tell the Gemini API which part of a file to load: a page range, a worksheet tab and cell range, a time interval in audio or video, and which content layers to include. Gemini counts and bills tokens only for the slice sent to the model.
Can I send Word, PowerPoint and Excel files to the Gemini API?
Yes. You can pass .docx, .doc, .dotx, .odt, .pptx, .ppt, .odp, .xlsx, .xls and .ods files inline or through the Files API as a document block with the matching MIME type. Gemini processes them the same way as PDFs.
Does file slicing cost extra?
Google does not list a separate fee. When you set processing options, Gemini bills only the selected pages, sheets, clips and content layers at the model’s normal token rates. Page images use about 280, 560 or 1,120 tokens per page at low, medium or high resolution.
Which models support file slicing?
Google’s announcement says slicing works across all Gemini 4 models. The document processing guide says the document and spreadsheet options work across all Gemini 3 and Gemini 4+ models, in user input and inside function results.
What are the file size limits?
Up to 50 MB per file, 1,000 pages per PDF, 2,000 pages or slides per Office or OpenDocument file, and 50,000 cells per sheet. The limits apply to the whole uploaded file even when you request only a slice.
Sources
- Google: Introducing file slicing controls in the Gemini API (November 23, 2026)
- Gemini API docs: Document understanding
- Gemini API docs: Video understanding
- Gemini API docs: Audio understanding
- Gemini API release notes