Gemini API File Slicing: Read Only the Part of a File You Need

Add a processing object to a Gemini API document block to send only chosen pages, sheets or layers, and Gemini bills just that slice. Checked 1 Dec 2026.

Title card on white. The title Gemini API File Slicing over a yellow underline, the lilac line read only the part of a file you need, a lilac pill reading only for the slice you send and a sky pill reading Gemini 3 and Gemini 4 models, beside a soft white loaf on a sky board with five yellow slices lifted out and yellow sparkles around them.

Gemini API file slicing lets you send part of a file, such as chosen pages, sheets and content layers, instead of the whole thing. Google says it bills “tokens only for the parts Gemini inspects.” You turn it on with a processing object, type set to static, on a document block. Checked 1 Dec 2026.

What is Gemini API file slicing?

It is a set of request fields that tell Gemini which part of a file to read. Google announced it in “Introducing file slicing controls in the Gemini API” on 23 Nov 2026, with direct upload of Microsoft Office and OpenDocument files. The post says you can “request only the pages, spreadsheet cells, media segments, and layers you need.”

The Gemini API changelog lists it on 18 Nov 2026 as “Multimodal file processing and slicing”, so you “only process and pay for the content you need.” The post says that when model APIs only take whole files, agents end up running “LibreOffice, PDF renderers, and ffmpeg inside the client harness to render and slice large files.” With slicing, the API does that work on Google’s side. The idea is simple: read only the part of a file you need.

How do you slice pages of a PDF, Word file or deck?

Set processing.page_options on the document block. The document understanding docs, read 1 Dec 2026, list these options, all optional:

  • start_page and end_page: the first and last page to include, counted from 1, inclusive.
  • content_layers: page_image for rendered pages, page_text for extracted text, or both. It defaults to page_image when processing is set.
  • resolution: set on the outer document block to low, medium (the default) or high.

This is the docs’ Python example. It sends pages 3 through 7 of a PDF, five pages, as page images at high resolution:

from google import genai

client = genai.Client()

uploaded_doc = client.files.upload(file="quarterly_report.pdf")

interaction = client.interactions.create(
    model="gemini-4-hydrogen",
    input=[
        {
            "type": "document",
            "uri": uploaded_doc.uri,
            "mime_type": "application/pdf",
            "resolution": "high",
            "processing": {
                "type": "static",
                "page_options": {
                    "start_page": 3,
                    "end_page": 7,
                    "content_layers": ["page_image"],
                },
            },
        },
        {
            "type": "text",
            "text": "Summarize the revenue bridge chart and footnotes on pages 3 through 7.",
        },
    ],
)

print(interaction.output_text)
Animation. On a white background, a soft white loaf of bread rests on a sky board. Five slices in the middle lift out and glow yellow, and a blue tag above them reads pages 3 through 7, while the rest of the loaf stays still. Tapping the loaf lifts the slices again.
The docs example sends only pages 3 through 7 of a PDF. Gemini API docs, read 1 Dec 2026.

What does each page cost in tokens?

On Gemini 4 and Gemini 3 models, the docs put a page image at about 280 tokens at low resolution, 560 at medium or 1,120 at high. Gemini 2.5 models use a “Flat 258 tokens per page.” The docs’ tip: “scan with page_text first. Then request page_image at high resolution only for pages with charts or dense layouts.” Google’s post calls this “Skim cheap, then zoom in.”

Animation. On a white background, a yellow ruler slides under a soft white page and stops at three marks. A lilac tag reads low 280, a sky tag reads medium 560 and a mint tag reads high 1,120, under a blue heading that reads tokens per page. Tapping the ruler measures the page again.
About 280, 560 or 1,120 tokens per page at low, medium or high. Gemini API docs, read 1 Dec 2026.

How do you slice a spreadsheet?

Set processing.spreadsheet_options. The docs list sheet_index for the worksheet position in tab order, visible_cells for a cell or range in A1 notation such as A1:G40, and content_layers: data for evaluated values, formulas for raw formulas and visual for a rendered snapshot of charts and layout. The default layers are data and formulas. The docs’ Python example:

from google import genai

client = genai.Client()

workbook = client.files.upload(file="financial_model.xlsx")

interaction = client.interactions.create(
    model="gemini-4-hydrogen",
    input=[
        {
            "type": "document",
            "uri": workbook.uri,
            "mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
            "resolution": "high",
            "processing": {
                "type": "static",
                "spreadsheet_options": {
                    "sheet_index": 2,
                    "visible_cells": "A1:H50",
                    "content_layers": ["data", "formulas", "visual"],
                },
            },
        },
        {
            "type": "text",
            "text": "Audit the EBITDA formulas and chart in Sheet 2 (A1:H50).",
        },
    ],
)

print(interaction.output_text)

Can an agent pick the slice itself?

Yes: your tools can return a sliced file inside a function_result block. The function calling docs say tools return “sliced pages, spreadsheet ranges, or media clips” with the same processing and resolution fields, and the model gets page counts and worksheet names “automatically so it can request narrower ranges on later turns.”

The docs example wraps this in a tool named inspect_document_pages.

Video works the same way: the video docs list start_offset, end_offset, fps and content_layers (frames, audio or transcript). Google’s post gives audio the same clipping.

How is a sliced file billed?

Only for the part you send. The docs say “Gemini counts and bills tokens only for the slice you send.” Under Sliced billing they count only “the selected pages, sheets, and content layers sent to the model.”

The pricing page, read 1 Dec 2026, has no line on slicing itself. It says “Tokens for the DOCUMENT modality (for example, PDFs) are billed at the image token rate.” On 1 Dec 2026 its Standard tab lists Gemini 4 Hydrogen, the model in the docs examples, at $1.50 per 1M input tokens in USD on the paid tier.

Animation. On a white background, a soft white document is cut into slices beside a mint piggy bank. One slice slides forward and lights yellow, and one blue coin leaves the piggy bank to pay for it under a lilac tag that reads only for the slice you send. The coins for the other slices stay in the piggy bank. Tapping the piggy bank plays it again.
Gemini counts and bills tokens only for the slice you send. Gemini API docs, read 1 Dec 2026.

Which models and files does it support?

Gemini 3 and Gemini 4 models, per the docs; Google’s post says it “works across all Gemini 4 models.” Each cell below was read on 1 Dec 2026 from the page named.

Feature What Google says Status Models File types Billing
page_options “Select a page range” (post) “available today” (post, 23 Nov 2026) Gemini 3 and Gemini 4 (docs) PDF, Office and OpenDocument documents and slides Selected pages and layers only (docs)
spreadsheet_options “Select a worksheet tab” (post) “available today” (post) Gemini 3 and Gemini 4 (docs) .xlsx, .xls, .ods Selected sheets and layers only (docs)
Video clipping “Clip time intervals” (post) “available today” (post) All Gemini 4 (post) Video Clipped interval and layers only (video docs)
Office file input “native file upload support” (post) Changelog, 18 Nov 2026; no Preview label Gemini 4, Gemini 3 and 2.5 (docs) .docx, .doc, .dotx, .odt, .pptx, .ppt, .odp, .xlsx, .xls, .ods Image token rate for DOCUMENT tokens (pricing)

Limits stay the same. The docs allow up to 50 MB per file, 1,000 pages per PDF, or 2,000 pages or slides per Office or OpenDocument file, and these apply “to the full uploaded file even when slicing.” Spreadsheets take up to 50,000 cells per sheet.

Who gets the most from file slicing?

We think slicing helps most when you write the agent code yourself, since it is a field in API requests. Munder Difflin is free and open source: a desktop app that runs a team of AI agents for all kinds of knowledge work, coding included, on your own computer. Its README, read 1 Dec 2026, lists Gemini CLI as an engine and says “Each agent picks its own, so one office can mix them.” It adds: “Each agent runs the real CLI you already use, signed in with your own plan.” Our what is Gemini CLI explainer covers that engine, how to install and use Munder Difflin covers setup, and more how tos sit in our Guides hub.

FAQ

What is Gemini API file slicing?

A way to send the Gemini API only part of a file: a page range, a worksheet tab, a cell range, a video clip or a content layer. Google announced it on 23 Nov 2026 and says it bills "tokens only for the parts Gemini inspects."

How do I turn on file slicing?

Add a processing object with type set to static on a document block, then set page_options for PDFs, documents and slides, or spreadsheet_options for workbooks. The docs, read 1 Dec 2026, say all these fields are optional.

Which models support Gemini file slicing?

The document understanding docs, read 1 Dec 2026, say Gemini 3 and Gemini 4 models support these options in user inputs and tool results. Google's post of 23 Nov 2026 says it works across all Gemini 4 models.

Can I send Word, PowerPoint and Excel files to the Gemini API?

Yes. The docs list .docx, .doc, .dotx, .odt, .pptx, .ppt, .odp, .xlsx, .xls and .ods. The limits are 50 MB per file and 2,000 pages or slides per Office or OpenDocument file, and they apply to the full uploaded file even when slicing.

How is a sliced file billed?

Only for what you send. The docs say "Gemini counts and bills tokens only for the slice you send." The pricing page, read 1 Dec 2026, says tokens for the DOCUMENT modality are billed at the image token rate.