Clarifying Gemini 2.5 Flash API Document Limits, Supported File Types, and Size Constraints

I am currently learning about generative AI and working on integrating Gemini 2.5 Flash into my platform via API calls. Before proceeding with implementation, I want to clarify my understanding of the document-related technical specifications in the official documentation:

https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-flash

From the documentation, it states that the maximum file size per file is 50 MB and that the supported MIME types for document input are application/pdf and text/plain.

Based on this, I want to confirm whether my interpretation is correct:

  1. Does this mean that, when using the API, only files corresponding to these MIME types (e.g., .pdf, .txt) are accepted as document inputs, and that formats such as .doc, .docx, .xls, .xlsx, or .csv are not supported directly?

  2. If those formats are not supported, is converting them into a supported format (for example, exporting to PDF or plain text) currently the only workaround?

  3. Given the 50 MB per file limit, if a document exceeds this size (e.g., a 160 MB file), is the expected approach to split the document into multiple chunks, each under 50 MB, before submitting them to the API?

  4. When using gemini google. com via the web UI, larger files and additional file types appear to be uploadable (potentially up to ~100 MB). Is this due to separate backend handling for the GUI, or are there supported API-side mechanisms that replicate this behavior?

  5. Has anyone successfully uploaded larger files or non-PDF/text document formats through the Gemini 2.5 Flash API, or identified alternative patterns for handling these cases?

Any clarification or implementation insights would be greatly appreciated. Thanks.

Hi @JasonYeo,
Welcome to the forum!

  1. As per the documentation other file types will be extracted as pure text and any file-type specifics like charts, diagrams, HTML tags, Markdown formatting, etc., will be lost.
  2. Converting unsupported formats into PDF is currently the most effective way to preserve document structure.
  3. For files exceeding 50 MB, we recommend splitting them into smaller chunks. Since there is no limit on the number of files you can upload, this ensures smoother processing.
  4. Please note that the Gemini web interface uses a different backend with its own specific mechanisms for handling file uploads.