#Google cli error
1 messages · Page 1 of 1 (latest)
That 403 is coming from Gemini for Google Cloud (a.k.a. Cloud AI Companion) and it basically means:
the identity you’re authenticated as does not have the IAM permission
cloudaicompanion.companions.generateChaton the GCP project shown in the error (.../projects/<PROJECT_ID>/locations/global).
What to check / fix
- Make sure you’re using the right project
- Look at the project in the error message (sometimes people accidentally hit
projects/cloudshell-gcaor some random default). - In Cloud Shell / local terminal, confirm:
gcloud config get-value projectgcloud auth list
- In Gemini CLI, explicitly set the project (their docs call this out):
https://geminicli.com/docs/get-started/authentication#set-your-google-cloud-project
- Enable the API in that project
Enable Gemini for Google Cloud API (cloudaicompanion.googleapis.com) on the same project:
- Or CLI (from Google’s setup doc):
gcloud services enable cloudaicompanion.googleapis.com --project <PROJECT_ID>
Docs: https://docs.cloud.google.com/gemini/docs/codeassist/set-up-gemini#enable-api
- Grant the right IAM role
Grant one of the roles that includescloudaicompanion.companions.generateChat(common ones):
- Gemini for Google Cloud User:
roles/cloudaicompanion.user - (Sometimes) Gemini for Google Cloud individual User:
roles/cloudaicompanion.individualUser
IAM reference showing which roles contain that exact permission:
https://docs.cloud.google.com/iam/docs/roles-permissions/cloudaicompanion (search forcloudaicompanion.companions.generateChaton that page)
- If this is “Code Assist Standard/Enterprise”: license/subscription
If you’re using the paid org product, you also need the subscription + user license assignment, otherwise you’ll keep getting blocked in various ways:
https://docs.cloud.google.com/gemini/docs/codeassist/set-up-gemini
If you paste (a) the exact projects/<...> from the error and (b) whether you’re in Cloud Shell vs local + which auth mode you used (Gemini CLI “login with Google” vs “use a GCP project”), I can tell you which of the above is the likely missing piece.
So basically, i can use gemini cli in chat through google/, but when I try to use gog and calls cron, it gives me No API key found for provider "google". So when I rename it to google-gemini-cli, it gives me 404 error. And project id and IAM is already set
google vs google-gemini-cli are different providers in OpenClaw, with totally different auth:
-
google/...= Gemini HTTP API → needsGEMINI_API_KEY(GCP project/IAM doesn’t matter for this one)
Docs: https://docs.openclaw.ai/concepts/model-providers#google-gemini-api-key -
google-gemini-cli/...= Gemini CLI OAuth plugin → does not useGEMINI_API_KEY, but you must enable the plugin + login (and restart gateway)
So if cron says “No API key found for provider google”, that cron/job (or the gog agent) is still configured to use google/..., and the gateway process running cron can’t see GEMINI_API_KEY (common when the gateway runs as a service and your shell env isn’t loaded).
Fix paths (pick one)
A) You want google/... (API key)
- Ensure
GEMINI_API_KEYis available to the gateway service, not just your terminal. - Relevant FAQ section (env vars disappearing under service):
https://docs.openclaw.ai/help/faq#i-started-the-gateway-via-the-service-and-my-env-vars-disappeared-what-now
B) You want Gemini CLI OAuth (no API key)
Don’t “rename” providers manually—use the official plugin flow:
From the FAQ:
- Enable:
openclaw plugins enable google-gemini-cli-auth - Login:
openclaw models auth login --provider google-gemini-cli --set-default
Docs: https://docs.openclaw.ai/help/faq#how-do-i-set-up-gemini-cli-oauth
(You’ll usually need a gateway restart after enabling the plugin.)
Quick triage questions (so we can pinpoint it)
- What’s your
openclaw --version? - What model is the working chat using vs what model the cron / gog agent is using? (provider/model string)
- Can you paste
openclaw models status? (it will show whether the gateway sees the key / profiles)
With those 3, we can tell if it’s (1) wrong provider selected for cron, or (2) env not reaching the gateway service, or (3) plugin not enabled/logged-in on the gateway host.
- Latest version
- So basically, if I just use gemini cli model, it gives me cloud code assist 403, however, if I just rename them to google/ (I’m using oauth method) it works fine. There’s no problem at all, and idk why but it works. So I understand it will give api key not found when I call cron, but it works fine in chat, like reply, does things and more. However my Gemini cli model just returns cloud code asssit 403 error… I need help with this shit
What you’re seeing is basically two different backends that just happen to both be “Gemini-ish”, but they auth completely differently:
1) Why google-gemini-cli is throwing Cloud Code Assist 403
The Gemini CLI provider (google-gemini-cli) routes through Google’s Cloud Code Assist / AI Companion API (cloudaicompanion.googleapis.com). That’s exactly why the permission in the error is:
cloudaicompanion.companions.generateChat
A 403 there almost always means your current identity + current GCP project does not have Gemini Code Assist / Gemini for Google Cloud access (IAM role and sometimes org entitlement/license), or the CLI is using the wrong project.
Gemini CLI requires you to explicitly set the GCP project it should use:
https://geminicli.com/docs/get-started/authentication#set-your-google-cloud-project
If the error mentions some weird project you don’t recognize (common examples are cloudshell-gca / hazel-proxy-...), that’s a huge hint the CLI isn’t using your project at all.
2) Why “renaming to google/...” appears to work (but then cron complains)
In OpenClaw, provider google is Gemini HTTP API (API key), not OAuth. It expects GEMINI_API_KEY (with GOOGLE_API_KEY as a fallback env var). Docs:
https://docs.openclaw.ai/concepts/model-providers#google-gemini-api-key
So if google/... “works in chat” but cron says “No API key found for provider google”, one of these is true:
- the gateway service that runs cron can’t see your env vars (super common when running as a daemon/service), or
- you’re not actually using provider
googlein the way you think (model routing/fallback/agent differences)
FAQ for the “service env differs from terminal env” problem:
https://docs.openclaw.ai/help/faq#i-started-the-gateway-via-the-service-and-my-env-vars-disappeared-what-now
The fastest way to unblock you
Pick what you actually want:
Option A — You want Gemini CLI OAuth
Then you need to make Gemini CLI itself happy:
- Ensure you’ve enabled + logged into the plugin on the gateway host:
openclaw plugins enable google-gemini-cli-authopenclaw models auth login --provider google-gemini-cli --set-default
- Make sure the CLI is pointed at a GCP project where your account has access (link above), and that Gemini for Google Cloud / Code Assist is enabled/allowed in that project/org.
If you don’t have Code Assist entitlements for that org/project, google-gemini-cli will keep 403’ing forever — that’s Google-side.
Option B — You just want it to work for cron + chat
Use either:
google-antigravity/...(OAuth plugin), orgoogle/...with a realGEMINI_API_KEYavailable to the gateway service
Don’t “rename” providers manually; the model ids + auth expectations differ and you’ll get 404/403 in weird combos.
One paste that will let me tell you exactly which case you’re in
Can you paste the output of:
openclaw models status
…and the exact project string from the 403 (the projects/<...> part).
That will immediately show whether you’re missing (a) plugin auth, (b) project selection, or (c) Code Assist entitlement/IAM.
Is antigravity available in current version. ???
Yes — Google Antigravity OAuth is available in current OpenClaw, but it’s shipped as a bundled plugin and is disabled by default.
Per the docs (Model providers + Plugins):
- Enable the plugin:
openclaw plugins enable google-antigravity-auth
- Then login + set it as default auth profile:
openclaw models auth login --provider google-antigravity --set-default
Docs:
After enabling a bundled plugin, you typically need a gateway restart for it to load:
openclaw gateway restart
If you run openclaw plugins list, you should see google-antigravity-auth in the list (enabled/disabled state).
Are you sure
Yep.
OpenClaw docs explicitly list Google Antigravity OAuth as a bundled plugin:
-
Model providers doc: it says “Antigravity OAuth is shipped as a bundled plugin (
google-antigravity-auth, disabled by default). Enable:openclaw plugins enable google-antigravity-auth. Login:openclaw models auth login --provider google-antigravity --set-default”
https://docs.openclaw.ai/concepts/model-providers#google-vertex-antigravity-and-gemini-cli -
Plugins doc also lists it under “Available plugins (official)” as bundled, disabled by default:
https://docs.openclaw.ai/tools/plugin
If you want to double-check on your install, run:
openclaw plugins list
openclaw plugins info google-antigravity-auth