cd /news/artificial-intelligence/gemini-api-file-slicing-read-only-th… · home › topics › artificial-intelligence › article
[ARTICLE · art-179585] src=munderdiffl.in ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

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

Google announced file slicing controls for the Gemini API on 23 Nov 2026, letting developers send only selected pages, sheets or content layers of a document and pay tokens only for the parts Gemini inspects, according to the Gemini API changelog entry dated 18 Nov 2026. Developers enable slicing by setting a `processing` object with `type` set to `static` on a document block, using `page_options` fields such as `start_page`, `end_page` and `content_layers`; the docs price a page image at about 280 tokens at low resolution, 560 at medium and 1,120 at high on Gemini 4 and Gemini 3 models, versus a flat 258 tokens per page on Gemini 2.5 models. Google's post says the feature removes the need for agents to run "LibreOffice, PDF renderers, and ffmpeg inside the client harness to render and slice large files.

key takeaway

Set `processing.type` to `static` with `page_options.start_page`/`end_page` and `content_layers` to bill only the selected pages, and scan with `page_text` first before requesting `page_image` at high resolution, which costs about 1,120 tokens per page versus 280 at low.

by read7 min views1 publishedDec 1, 2026
Gemini API File Slicing: Read Only the Part of a File You Need
Image: Munderdiffl (auto-discovered)

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.

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 andend_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 topage_image whenprocessing is set.
  • resolution : set on the outer document block tolow ,medium (the default) orhigh .

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)

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.”

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.

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.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @google 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/gemini-api-file-slic…] indexed:0 read:7min 2026-12-01 · —