gemini-cli - 💡(How to fix) Fix bug: 403 PERMISSION_DENIED error when using Google OAuth or API Key via CLI [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25749Fetched 2026-04-22 08:03:36
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Error Message

I am consistently receiving a 403 PERMISSION_DENIED error when executing any command in the Gemini CLI. This issue started suddenly about 24 hours ago. Prior to this, the CLI was working perfectly with the same setup Error Message : ✕ [API Error: [{ "error": { The error appears immediately after the request is sent Tried using a freshly generated API Key from AI Studio (same error: 403 Forbidden or Your project has been denied access)

Code Example

> /about
# paste output here
RAW_BUFFERClick to expand / collapse

What happened?

I am consistently receiving a 403 PERMISSION_DENIED error when executing any command in the Gemini CLI. This issue started suddenly about 24 hours ago. Prior to this, the CLI was working perfectly with the same setup

Error Message :

✕ [API Error: [{ "error": { "code": 403, "message": "The caller does not have permission", "errors": [ { "message": "The caller does not have permission", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } ]]

To Reproduce Steps to reproduce the behavior:

  • Run any gemini command (e.g., gemini "hello")
  • Authenticate via Google Login or provide a valid API Key

The error appears immediately after the request is sent

What did you expect to happen?

The CLI should return a generated response from the Gemini model, as it does on the Google AI Studio web interface

Additional Context : Web/AI Studio Status: Working perfectly. I can generate prompts on aistudio.google.com and gemini.google.com without any issues using the same account

Authentication Tried: Authenticated via Google Login (OAuth).

Tried using a freshly generated API Key from AI Studio (same error: 403 Forbidden or Your project has been denied access)

Region: Pakistan (Karachi) Timeframe: Issue has persisted for over 24 hours Environment: Windows 10

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
</details>

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The most likely fix is to review and adjust the API key or authentication settings, as the 403 PERMISSION_DENIED error suggests a permission issue.

Guidance

  • Verify that the API key is correctly generated and applied, considering the recent changes or updates in the AI Studio or Gemini services.
  • Check if there are any regional restrictions or access limitations for the Gemini CLI in Pakistan (Karachi), as the web interface is working fine.
  • Try using a different authentication method, such as switching from Google Login to API Key or vice versa, to isolate the issue.
  • Review the Gemini CLI documentation for any specific requirements or updates related to authentication and permissions.

Example

No code snippet is provided as the issue is related to authentication and permissions, and no specific code changes are implied.

Notes

The issue may be related to a recent change in the Gemini service or AI Studio, and it's essential to review the documentation and release notes for any updates on authentication and permissions. Additionally, regional restrictions or access limitations may be a contributing factor.

Recommendation

Apply a workaround by trying a different authentication method or reviewing the API key settings, as the root cause of the issue is likely related to permissions or authentication.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

gemini-cli - 💡(How to fix) Fix bug: 403 PERMISSION_DENIED error when using Google OAuth or API Key via CLI [1 participants]