Introducing file slicing controls in the Gemini API Google launched file slicing controls in the Gemini API across Google AI Studio and the Gemini platform, letting developers pass PDFs, Office and OpenDocument files, audio, and video directly and request only the pages, spreadsheet cells, media segments, and layers they need, with tokens billed only for the parts Gemini inspects. The controls work across all Gemini 4 models and include page ranges and resolution for documents, sheet_index and visible_cells for spreadsheets, start_offset/end_offset clipping plus fps for video, and time-interval clipping for audio, alongside native upload support for Microsoft Office and OpenDocument formats. Google said the server-side slicing removes the need for agents to run LibreOffice, PDF renderers, and ffmpeg in the client harness, and that files uploaded once via the Files API can be reused by URI across turns and tool calls. Introducing file slicing controls in the Gemini API Today, we're launching new file slicing controls https://ai.google.dev/gemini-api/docs/document-processing customize-document-processing in the API across Google AI Studio https://aistudio.google.com/ and Gemini platform https://cloud.google.com/vertex-ai , alongside native file upload support for Microsoft Office and OpenDocument formats. 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. This keeps context focused on the relevant parts of a file while billing tokens only for the parts Gemini inspects. Inspect only what you need Real-world knowledge work lives in dense PDFs, slide decks, multi-tab workbooks, and long recordings. With server-side slicing, you do not have to flatten files to plain text or ingest entire files up front. - Upload once, slice across turns: Upload a file once with the Files API and reuse its URI across turns and tool calls. - Give your agent control: The API lets the agent specify what parts of a file to inspect directly inside a function response https://aistudio.google.com/docs/function-calling file-inspection-options for faster and more efficient multi-turn workflows - Skim cheap, then zoom in: Skim first with extracted text, low-res previews, or transcripts, then spend high-resolution tokens only on the charts, dense layouts, and frames that matter. Slice documents, spreadsheets, and videos and more by range, layer, resolution, and frame rate to control token usage. Make your harness multimodal without local bloat When model APIs only ingest whole files, agents end up running LibreOffice, PDF renderers, and ffmpeg inside the client harness to render and slice large files. This bloats memory, clutters local disk with extracted frames, and forces enterprise platforms to maintain per-user sandboxes just to slice files. With the Gemini API, pass a Files API URI on a user turn or directly inside a function response https://ai.google.dev/gemini-api/docs/function-calling file-inspection-options function result , and the API natively slices, renders, and tokenizes each file server-side the way the model was trained to see it. How it works Native file slicing works across all Gemini 4 models, and existing file size and page limits still apply to the uploaded file. You can customize processing across these media categories: - Documents and slides https://aistudio.google.com/docs/document-processing page-options PDF, Office and OpenDocument formats https://aistudio.google.com/docs/document-processing office-documents : Select a page range start page, end page , set resolution low, medium, or high , and choose content layers page text or page image . - Spreadsheets https://aistudio.google.com/docs/document-processing spreadsheet-options .xlsx, .xls, .ods : Select a worksheet tab sheet index and cell range visible cells , set resolution low, medium, or high , and select content layers data, formulas, and visuals . - Video https://aistudio.google.com/docs/video-understanding customize-video-processing : Clip time intervals start offset, end offset , adjust fps and resolution low, high , and choose content layers transcript, frames, or audio . - Audio https://aistudio.google.com/docs/audio clipping-intervals : clip time intervals start offset, end offset with ease. When processing options are omitted from API calls, documents and slides default to layout-preserving page images, and spreadsheets include evaluated values, formulas, and sheet names across all tabs. Example: Skim at a high level, zoom in on details Upload a Word document once to the Files API, skim every page cheaply as extracted text to locate the right section, then reuse the same URI to inspect a single page at high resolution: python from google import genai client = genai.Client doc = client.files.upload file="quarterly report.docx" 1. Skim the whole document cheaply as extracted text. skim = client.interactions.create model="gemini-4-hydrogen", input= { "type": "document", "uri": doc.uri, "mime type": doc.mime type, "processing": { "type": "static", "page options": {"content layers": "page text" }, }, }, { "type": "text", "text": "Which page has the revenue bridge chart?", }, , print skim.output text 2. Zoom into the target page at high resolution reusing the same URI . detail = client.interactions.create model="gemini-4-neon", input= { "type": "document", "uri": doc.uri, "mime type": doc.mime type, "resolution": "high", "processing": { "type": "static", "page options": { "start page": 3, "end page": 3, "content layers": "page image" , }, }, }, { "type": "text", "text": "Read the revenue bridge chart and footnotes on page 3.", }, , print detail.output text Early adoption across agent frameworks Gateway and SDK partners validated these controls ahead of launch, cutting prompt token spend directly in production harnesses: Get started Native file slicing, content-layer controls, and expanded files support are available today via the API in Google AI Studio and the Gemini platform. Check out our docs https://aistudio.google.com/docs/document-processing?e=0 to start building.