minssam.
Published on

Gemini API File Slicing: Send Only the Pages You Need and Cut Token Costs by 93%

You only need two pages from a 300-page report, but you have been sending all 300 pages to the AI anyway.

Google just fixed that. On November 23, 2026, File Slicing arrived in the Gemini API.


What Is File Slicing?

In the previous model, sending a PDF, spreadsheet, or video to the Gemini API meant the entire file went to the model. Extracting a 10-page summary from a 1,000-page document still consumed all 1,000 pages' worth of tokens.

File Slicing changes this. When developers make an API request, they specify upfront which portion of the file to process. The server tokenizes only that slice and sends it to the model.

Supported file types and slice units:

  • PDF: Page range (e.g., pages 5–10)
  • Spreadsheet: Cell range or sheet-level selection
  • Video/audio: Timestamp range

How Much Can You Save? Up to 93%

Partner test results are striking:

  • Up to 93% fewer tokens reported for large PDF processing
  • 33% reduction measured for a full spreadsheet workbook

Why the gap? A 500-page annual financial report might contain 10–20 pages of content you actually need. File Slicing makes the other 480 pages invisible to the model β€” that is what drives the savings.


Developer Use Cases

EdTech platforms: Restrict AI analysis to the chapter a learner is currently studying, rather than the entire textbook PDF. Lower cost, faster response.

Legal and consulting AI tools: Process only the specific clauses or sections that matter. No need to expose confidential pages to the model.

Video analysis apps: Pull only a 10-minute highlight segment from a one-hour lecture and send that to Gemini for summarization.


An Important Technical Note

File Slicing is not about cutting the file on the client side before sending. When a developer includes slice parameters in an API request, Google''s server renders and tokenizes only that portion of the file.

This means two things:

  1. No preprocessing is needed β€” the implementation is straightforward
  2. The rest of the file is uploaded but never sent to the model, so there is no token charge for it

One caveat: this feature launched in the Gemini API for developers first. Whether the same controls reach the consumer Gemini app has not been officially confirmed by Google yet.


An EdTech CEO Perspective: The Cost Structure Changes

Token usage is where most AI app costs live. File Slicing is not about making AI smarter β€” it is about structurally eliminating unnecessary cost.

Running an EdTech platform, I watch document processing costs grow linearly with the number of learners. File Slicing cuts that burden and can actually improve accuracy at the same time: less irrelevant context means the model focuses better on what matters.


Tips

1. Understand your file structure first The more precisely you know which pages or segments you need, the more you save. Run a table-of-contents extraction or keyword scan as a preprocessing step.

2. It is especially powerful for batch workflows When processing many documents with the same structure, template your slice parameters. Cost prediction becomes much more reliable.

3. Leave a little buffer at the boundaries Important content can straddle page breaks. Add a page or two of margin beyond your actual target range to avoid missing anything.


Sources:

Gemini API File Slicing: Send Only the Pages You Need and Cut Token Costs by 93% | MINSSAM.COM