File size limit (413 Request Entity Too Large)

Hi folks,

I’m currently working with the Gemini API and planning to send an image by encoding it (e.g., base64) directly in the request payload. Before proceeding, I wanted to check:

Is there any official documentation or guideline that specifies the file size limit for image uploads via the Gemini API endpoint?

Any insights or pointers to the relevant documentation would be greatly appreciated especially gemini-2.0-flash-001. Thanks in advance!


Hey @Ngyn_An , It is advised to use File API when the combined size of image files and system instructions you intend to send exceeds 20 MB. Also, if you are using flash-2.0 and send a larger image file, it will be cropped and scaled down automatically.

Please refer to the documentation for more detailed information.

Thanks.