Replies: 2 comments
-
|
having this problem as well, any solution? |
Beta Was this translation helpful? Give feedback.
-
|
The "Error 401: invalid_client" with "OAuth client was not found" is a common authentication issue in Gemini CLI. Here's the solution: Root CauseThis happens when the OAuth credentials are not properly set up or the API key is invalid/expired. Solutions (Try in Order):Solution 1: Refresh API Key
Solution 2: Clear OAuth CacheThe CLI caches OAuth tokens. Clear them: Linux/Ubuntu: Or: MacOS: Windows: Solution 3: Re-authenticateAfter clearing cache, run fresh login: Then follow the browser OAuth flow. Solution 4: Check Environment VariablesMake sure your API key is correctly set: export GEMINI_API_KEY=your_actual_key Verify it's set: Solution 5: Use API Key Method (Alternative)Instead of OAuth, use direct API key:
Additional Troubleshooting:
Let me know which solution works or if you see a specific error message with --debug flag! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
ubuntu 24.04
Access blocked: Authorization Error
xxxxxxxxx@gmail.com
The OAuth client was not found.
If you are a developer of this app, see error details.
Error 401: invalid_client
Beta Was this translation helpful? Give feedback.
All reactions