403 PERMISSION_DENIED only on generateContent with file_data/file_uri — uploads succeed, text/inline succeed (prepay account, key restricted to Gemini API)

Since ~11:17 UTC on Aug 14, every generateContent call that references a Files API upload returns 403 PERMISSION_DENIED (“The caller does not have permission”), while every other call type on the same API key works. The identical call shape worked at 10:46 UTC the same day (a 131 MB video analyzed successfully), so onset was between 10:46 and 11:17 UTC.

Reproduction matrix (same key, same project, minutes apart):

  • GET /v1beta/models → 200
  • generateContent, text only → 200
  • generateContent, inline_data image → 200
  • POST /upload/v1beta/files → 200, file reaches state ACTIVE
  • generateContent referencing that just-uploaded ACTIVE file via file_data.file_uri → 403 PERMISSION_DENIED

Reproduced with a 1-pixel PNG, so not size/duration/content related. Model: gemini-3.5-flash. The 403 body carries no detail beyond code/message/status.

Account state (the standard first questions, pre-answered):

  • Billing: the account had the “required to use prepay billing” notice; we completed the Prepay switch mid-incident and purchased credits (balance positive, no balance due, banner cleared). The 403 persisted unchanged through 22 once-per-minute probes after the switch.
  • API key: restricted to the Gemini API per the June 19 policy (key created Mar 29, 2026; restriction verified in Cloud Console today).
  • status.cloud.google.com shows no relevant incident.

This looks like the account-level flag class identified in recent threads (177857, 177451, 176394) — but scoped narrowly to file-referenced generation only: uploads succeed and reach ACTIVE, text and inline generation are unaffected. Closest precedents: deprecated-generative-ai-python issue 692 (same shape, Feb 2025, never root-caused) and discuss.google.dev topic 282362 (Vertex: text OK, fileData 403, attributed by staff to a project-level media-ingestion capability).

Project: gen-lang-client-07441523.. (billing account ID available via DM). Region: Malaysia. Happy to provide exact request timestamps for correlation.

Ask: could someone check/reset the file/media-generation permission flag on this project? Uploads clearly carry permission; only generation against our own ACTIVE files is refused.

Hello @Erica_Lsy ,

We recently rolled out a fix that should have resolved this issue. Request you to retry and let us know if you still face the issue

Hey @Sai_Deepika_K, we are experiencing the same issue. Uploading as a base64 encoded attachment works (using the data prop), but we get an error when using the uriprop to just point to the URL instead.

{
  message: 'The caller does not have permission',
  code: 'permission_denied'
}

Hello @Mark_Francis ,

Could you clarify if you are passing a direct external web URL or a file URI returned by the Gemini Files API?

It’s a direct URL, pointing to an S3 bucket hosted by us. The content within is publicly available

just reproduced this today (sep 10th), bytes upload works fine, public URL with asset (s3 presigned) does not