Gemini API: Office Files and Slicing of Documents, Spreadsheets, Video and Audio So You Pay Only for What You Need

Gemini CLIView original changelog

The Gemini API now accepts Microsoft Office and OpenDocument files (Word, PowerPoint and Excel) directly as input. Developers can also slice documents, spreadsheets, video and audio in prompts and function responses by page range, worksheet tab, cell range, time interval or content layer. This lets applications process and pay for only the content they need.

Key Takeaways

  • The Gemini API now accepts Word, PowerPoint and Excel files, plus OpenDocument formats, directly, with no conversion step.
  • Slicing lets requests select page ranges, worksheet tabs, cell ranges or time intervals instead of sending an entire file.
  • Developers pay only for the content they select, which can cut cost sharply on large documents and long recordings.
  • Slicing also works in function responses, so tools can return just the relevant part of a big file to the model.
  • Content layers (page images, extracted text, formulas, video transcripts) let developers choose which representation of a file the model receives.
  • The change covers documents, spreadsheets, video and audio under one consistent approach, documented in the Document, Video and Audio understanding guides.

Office and OpenDocument Files as Direct Input

Google added support in the Gemini API for passing Microsoft Office and OpenDocument files straight to the model. Word, PowerPoint and Excel files, along with their OpenDocument counterparts, can be included without first converting them to PDF or extracting text. This removes a preprocessing step for any application that handles business documents.

Slicing Media to the Parts That Matter

Alongside the new formats, Google introduced slicing. Developers can now select just a portion of an input instead of sending the whole thing. The selection options depend on the media type:

  • Documents: page ranges.
  • Spreadsheets: worksheet tabs and cell ranges.
  • Video and audio: time intervals.
  • Content layers: page images, extracted text, formulas or video transcripts.

Slicing works in user prompts and in function responses, so a tool called by the model can also return only the relevant slice of a large file.

Lower Cost and Less Noise

Because only the selected content is processed, developers pay only for the portion they choose. A 300-page report where only a chapter matters, a workbook where only one tab is relevant, or an hour-long recording where only five minutes are needed no longer has to be sent in full. Smaller inputs also keep the model focused on the relevant material.

Choosing Content Layers

The content layer option lets a request ask for a specific representation of a file, such as page images for layout-sensitive questions, extracted text for plain content, formulas for spreadsheet logic, or a transcript for video. This gives developers control over what the model sees and what it costs. Google points to its Document understanding, Video understanding and Audio understanding guides for details.