We’re trying to switch from using FileAPI for image uploads in Gemini API to setting Image URLs in the file_data.file_uri field, but it’s not working. file_data.file_uri with external HTTPS Image URLs always returns 429 RESOURCE_EXHAUSTED (Tier 3, single URL, Files API control succeeds)
Project: paid, Tier 3 · API: generativelanguage.googleapis.com · Model: gemini-3.7-flash · Dates observed: Aug 25–26, 2026 (PDT)
We’ve been using FileAPI for image uploads in Gemini requests, but we have such a high volume of images per request (thousands per Gemini call) that FileAPI isn’t a good fit, since we’re nearly exceeding FileAPI storage limits. We read somewhere that generateContent now accepts public and pre-signed HTTPS URLs in file_data.file_uri. We tried switching to attaching images to file_uri, but every such request fails immediately with 429 RESOURCE_EXHAUSTED (including requests containing a single URL) while the identical request using Files API handles succeeds.
What we tested
- Requests with 1, 10, 25, 50, 100, and 261 image URLs (JPEG, ~64 KB each, pre-signed Cloudflare R2 GET URLs, 10-minute TTL). Every request returned 429 {“status”:“RESOURCE_EXHAUSTED”,“message”:“Resource has been exhausted (e.g. check quota).”}. Latency before failure scaled with URL count (~1–5 s at 1–10 URLs, ~60 s at 261), suggesting fetching begins and then a quota trips.
- Control: the same prompt and the same 261 frames sent as Files API references succeeded repeatedly (32–41 s end-to-end, ~138k prompt tokens), interleaved between the failing URL requests, so RPM/TPM/RPD are not the limiting factor (console shows <15% peak on all listed quotas).
- The same pre-signed URLs download successfully via plain HTTPS GET from our servers, and requests stayed under the documented 100 MB limit and the URL-context tool’s 20-URLs-per-request cap (we fail at 1).
- Reproduced identically with API keys from two separate projects (this production project and our staging project).
We checked the project’s quota page for the Generative Language API (Quotas & System Limits) which shows no quota named for URL retrieval / media fetch / external file fetching, so there is nothing visible to request an increase on.
Questions
- Is external-URL retrieval for file_data.file_uri gated or separately provisioned per project? Is it something I have to enable somewhere?
- If it’s quota-governed, which quota is it, and how do we request an increase (it isn’t visible on the quota page)?
- If it’s neither, can you advise why single-URL requests return RESOURCE_EXHAUSTED on a Tier 3 project?