Google's Gemini API Adds File Slicing, Cuts Prompt Tokens by 67%
Google's Gemini API now slices PDFs, spreadsheets and media server-side, billing only inspected content. LiteLLM reports 67% prompt-token cuts on PDFs; Office files upload natively.
By Nathan Brooks
4 min read

What's News
- Google launched native file slicing in the Gemini API on November 23, 2026, billing tokens only for inspected content.
- LiteLLM's testing showed slicing cut prompt tokens by 67% on a PDF and 33% on a workbook.
- Gemini page images cost roughly 280 tokens per page at low resolution, 560 at medium and 1,120 at high.
- Vercel reported text skimming used 14x fewer tokens than rendering a whole PDF in production.
- Upload limits hold at 50 MB per file, 1,000 PDF pages and 50,000 cells per sheet; Files API storage lasts 48 hours.
Google launched native file-slicing controls in the Gemini API on November 23, 2026, and LiteLLM's testing shows the feature cut prompt tokens by 67% on a PDF and 33% on a workbook. Alongside the slicing, the API now accepts Microsoft Office and OpenDocument files natively, with tokens billed only for the content Gemini actually inspects.
The update targets agents that need one chart inside a long report, one worksheet in a multi-tab workbook, or a short passage buried in a recording. Instead of converting and loading an entire file on the client side, developers send a Files API URI and let Google slice, render and tokenize server-side. That trims prompt-token spend and the local processing work that surrounds the model call.
What can developers slice?
The new controls split along document type:
- PDFs, documents and presentations: inclusive start and end pages; a choice of extracted page text, rendered page images, or both; and low, medium or high rendering resolution.
- Spreadsheets: worksheet selection by tab position, plus an A1-style
visible_cellsrange. Responses can return evaluated data, raw formulas, or a rendered visual for charts and layout. - Video: static video mode, which samples frames at a fixed rate, supports start and end offsets, custom sampling up to 24 frames per second, and transcript, frames or audio layers.
- Audio: offsets in seconds. An omitted start defaults to zero; an omitted end runs to the file's end. Only the selected duration gets billed.
For supported Office and OpenDocument files, Google set sensible defaults. Omitted processing options leave Gemini 4 and later models with medium-resolution page or slide images for documents and presentations, and all sheets with values, formulas and sheet names for spreadsheets.
How the token math works
Gemini counts and bills tokens only for the sliced output sent to the model. For Gemini 3 and Gemini 4 page images, Google estimates roughly 280 tokens per page at low resolution, 560 at medium, and 1,120 at high.
That means resolution has quietly become a cost control, not just a detail setting. A team can skim cheap text or transcripts to locate material, then reserve high-resolution rendered images for charts or dense layouts. The per-page gap matters at scale: a 1,000-page PDF rendered fully at high resolution would consume roughly 1.12 million tokens, while low-resolution rendering of the same document costs about a quarter of that.
Upload limits didn't relax with the slicing feature:
- 50 MB per file
- 1,000 pages per PDF
- 2,000 pages or slides per Office or OpenDocument file
- 50,000 cells per spreadsheet sheet
Files API uploads stay stored for 48 hours, and the Files API itself is free in regions where the Gemini API is available.
Reusable files and smarter agents
A file can be uploaded once and its URI reused across turns and tool calls. Tools can return sliced pages, spreadsheet ranges or media clips inside function_result — the response a tool sends back to the model. The function-calling reference notes the model automatically receives page counts and worksheet names, so it can request narrower ranges on later turns.
That's the mechanism behind the savings: a cheap text or transcript skim first, then a high-resolution inspection of the one page or clip that matters.
Vercel reported a concrete production number of its own. Extracting text to skim a document page used 14 times fewer tokens than rendering the whole PDF, the company said. LiteLLM's figures — 67% token reduction on a PDF, 33% on a workbook — came from its own testing, and the feature works through LiteLLM's Gemini routes without additional setup.
What does this change for agent builders?
The trade-off is now explicit. Text and transcripts provide the low-cost path to locate material, while page, frame and resolution choices control the cost of closer inspection. In practice, that shifts optimization work from file preprocessing — the old convert-and-chunk pipeline — to search quality inside the model loop.
The quality of that first-pass search is therefore central to whether the partner-reported savings carry over to other document and media workflows. If the skim finds the right page, the savings compound; if it misses, you pay for a second pass.
Native slicing, the content-layer controls and the expanded file support are available now through the API in Google AI Studio and Gemini for business. Google says native slicing works across all Gemini 4 models, and the document, presentation and spreadsheet controls also support Gemini 3.
Source: unite.ai
More from Nathan Brooks
Show full bio
News editor covering regulation, policy and their impact on entrepreneurship, startups and venture funding at Business Bearings.
2,695 articles