Only part of a file goes to the model

Google has made it possible for developers on the Gemini API to slice PDFs, Office files, audio and video so that an AI model reads only the parts they need. Developers can specify page ranges for documents and presentations, worksheet tabs and cell ranges for spreadsheets, and time intervals for audio and video. According to Google's release notes, the feature lets developers process and pay for only the content sent to the model. The same options work both in user input and in the results that tools (functions) used by the AI return to the model.

Logan Kilpatrick, who works on the Gemini API and related products, presented the feature on X on Nov. 23 (early Nov. 24 Japan time). He said developers can now pass PDFs, Office files (docs, slides, spreadsheets), audio and video directly and request only the pages, cells, media segments and "layers" they need, and wrote that it was "shipping today."

Nice Gemini API quality of life update shipping today: You can now pass PDFs, Office files (docs, slides, spreadsheets), audio, and video directly to the Gemini API and request only the pages, spreadsheet cells, media segments, and layers you need. Read more:

Kilpatrick says in his X profile that he works on Gemini, Google AI Studio, the Gemini API and other products, and that his posts are his own views. Google's release notes list the feature under a Nov. 18 entry titled "Multimodal file processing and slicing." The materials do not explain the difference between "shipping today" in the post and the date in the release notes.

Billing covers only the slice

According to Google's "Document understanding" page, when processing options are set, tokens (the units of text an AI reads) are counted and billed only for the pages, sheets and layers sent to the model. The document and spreadsheet options work across all Gemini 3 and Gemini 4 and later models, in both user input and tool results.

For PDFs, Word and PowerPoint files, developers specify the first and last pages to read, counting from 1. They choose between rendered page images, extracted text, or both. When options are set, the default is page images.

Page image token counts depend on resolution. Google says Gemini 4 and Gemini 3 models use about 280 tokens per page at low resolution, about 560 at the default medium resolution and about 1,120 at high resolution. For large documents, Google recommends scanning the whole file as text first and then reading only pages with charts or dense layouts as high-resolution images.

Tokens used to read page images with Gemini 4 and Gemini 3 models, according to Google's "Document understanding" pageTokens per page (approx.)
280
Low
560
Medium (default)
1120
High

Spreadsheets: tabs, cell ranges and images

For Excel XLSX and XLS files and OpenDocument ODS files, developers can specify which worksheet to read and a cell range such as "A1:H50." They choose among evaluated cell values (data), raw formulas (formulas) and a rendered snapshot of the sheet for charts and layout (visual). The default is values and formulas.

When a whole file is passed without options, Gemini 4 and later models read the values, formulas and sheet names of all sheets. Gemini 3 and 2.5 models read all sheets as values-only CSV (comma-separated text data). Word, PowerPoint and similar files are read as page images by Gemini 4 and later, and as extracted text by Gemini 3 and 2.5.

Video: frames, audio or transcript

For video, developers can clip an interval by setting start and end offsets in seconds, and can set how many frames per second to sample (up to 24). They choose among sampled frames (frames), the audio track (audio) and a timestamped transcript (transcript). The default is frames and audio, and transcripts are billed as text tokens. For long videos, Google gives the example of reading the transcript first at low cost to find timestamps, then reading only that clip as frames.

Audio can likewise be clipped by start and end offsets in seconds. Billing covers only the clipped duration.

Tool results can be sliced, too

In an "agent," where the AI carries out work on its own, the model calls tools and the tools return results. According to Google's "Function calling" page, tools can return sliced page ranges, spreadsheet ranges and media clips in the same way. The model automatically receives page counts and worksheet names so it can request narrower ranges on later turns.

The ability to put Office files, audio and video in tool results came in an earlier update dated Nov. 5. In addition to images, PDFs and text, Google then let tools return Word, PowerPoint, Excel and similar files as well as audio and video, and added a way to return the location of a file stored with the Files API. For video, developers can also choose "agentic" processing, in which the model navigates the timeline itself and reads only the scenes it needs.

According to the "Video understanding" page, agentic processing is supported by "Gemini 4 Carbon," "Gemini 4 Argon," "Gemini 4 Neon" and "Gemini 4 Hydrogen," as well as Gemini 3.8 Flash, 3.6 Flash and 3.5 Flash Lite. Google says it can cut video input token usage by up to 88% for long videos of more than 5 to 10 minutes. For short videos or whole-video summaries, Google says standard processing avoids the extra thinking and tool-call tokens. Gemini 4 Neon was released on Nov. 18 (Nov. 19 Japan time) (earlier article).

Limits apply to the whole file

Even when slicing, file size and page limits apply to the whole file. The limits are 50 MB per file, 1,000 pages per PDF and 2,000 pages per Office or OpenDocument file. Spreadsheets can be read up to 50,000 cells per sheet.

Google does not give examples of how much costs fall when options are set. ORIENS has not tested the API and has not confirmed how much costs actually fall.

Unannounced schema fields become a formal feature

The feature had surfaced before the formal release. On Nov. 16 (early Nov. 17 Japan time), a bot that detects API changes reported unannounced fields in the Gemini API's public schema for detailed control of spreadsheet, document and audio inputs, and ORIENS confirmed them the same day (earlier article). At the time, the official documentation said only the first sheet of XLSX and XLS files was read.

According to the release notes, Google added the slicing feature in an entry dated Nov. 18, the next day. The current "Document understanding" page says all sheets are read if no sheet index is given. On the point where the public schema and the SDKs (software development kits) gave conflicting descriptions at the time, the documentation now says all sheets are read.

Developments around file processing in the Gemini API. Nov. 5 and Nov. 18 are release-note dates; Nov. 17 and Nov. 24 are Japan time. Based on Google's materials, the X post and earlier ORIENS articles
  1. Tools can return documents, audio and videoOfficial
  2. Unannounced spreadsheet, document and audio fields in public schemaLeak
  3. File slicing feature in release notesOfficial
  4. Kilpatrick presents it on X as "shipping today"Involved party