Gemini API Now Slices Files to Cut Token Costs by Up to 93%

Google's Gemini API can now load only the pages, cells or video moments a task actually needs, so apps stop paying tokens for the rest of the file.
Pay only for the part you read
Google has added native file-slicing controls to the Gemini API, letting applications send selected portions of an uploaded file to a model instead of the whole thing. The release also adds direct uploads for Microsoft Office and OpenDocument formats alongside PDFs.
Applications can now target specific pages, spreadsheet cells, media intervals and content layers. Gemini processes the requested slice on Google's servers, keeping unrelated material out of the context window and billing input tokens only for the content the model actually loads.
Why whole-file uploads waste tokens
Document-heavy AI agents often carry a separate media pipeline alongside the model integration. Pulling a single page or video segment out of a file can require LibreOffice, PDF renderers, ffmpeg, temporary storage and isolated execution environments.
Server-side slicing moves that work into Gemini. An application uploads a file once through the Files API, reuses its URI across turns, and specifies the required slice with each request. Gemini then renders and tokenizes that material in the format the model expects.
Skim cheaply, then zoom in
A typical agent can split file analysis into four steps: upload the file once and keep its Files API URI; request extracted text, transcripts or low-resolution previews to locate the relevant material; identify the pages, cells, frames or time intervals needed; then load those sections at higher resolution or with additional content layers.
For example, an agent can run a low-cost text extraction pass to find a revenue chart, then request that single page as a high-resolution image. Tool-enabled agents can specify a file slice inside a function response and reuse the same URI across turns.
What you can slice, by file type
The controls cover documents, spreadsheets, audio and video, and work across all Gemini 4 models. Documents and presentations support page ranges with low, medium or high resolution, plus text or image content layers. Spreadsheets support tab selection, visible cell ranges and a choice of data, formulas or visuals. Video supports start and end offsets with adjustable frame rate and resolution, plus transcripts, frames or audio. Audio supports start and end offsets for a specific interval.
Calls that omit processing options keep broad defaults: documents use layout-preserving page images, while spreadsheets include evaluated values, formulas and sheet names from every tab. Applications that want token savings must specify the relevant slices or content layers.
Early results look promising
Google cites partner tests showing large savings. Vercel reported that extracting text from a document page consumed one-fourteenth as many tokens as rendering the complete PDF. LiteLLM reported prompt-token reductions of 67% for a PDF and 33% for a workbook when routing Gemini traffic with slicing enabled.
Those figures come from partner workloads, so savings will vary with file structure, selected layers, resolution and the proportion of each file loaded. The complete file must still satisfy existing Files API size and page caps; slicing reduces model input and context use after upload.
Available now
Native slicing, content-layer controls and the expanded file-format support are live now through the Gemini API in Google AI Studio and Vertex AI, at the standard token rate for the content loaded by the model. For agents that process long PDFs, multi-tab workbooks or lengthy recordings, the feature can remove client-side conversion jobs and constrain each request to the material the task actually requires.
Comments (0)