Posts

I had free Google Cloud credit. I had my agent, Mavi, running on OpenClaw. And Google had Gemini, a model I already wanted to use.

Three pieces that were basically begging to fit together.

They refused. For months. 😅

At first I was sure it was my fault. Wrong model, wrong project, some setting buried three menus deep in Google Cloud. So I did the honest developer thing: made new keys, flipped settings, read the docs, dug through forums. Every door opened onto a new error.

Sometimes the request died instantly. Sometimes the auth looked perfect and OpenClaw still shrugged. And sometimes everything connected, yet my credit sat there, completely untouched.

Eventually I did the thing this whole blog is really about. I stopped grinding on it alone and handed the problem to my agent.

Not “fix it for me” in one magic prompt. More like sitting down together: me pointing at the wall we kept hitting, her chasing down every lead faster than I ever could while I steered.

And she found the clue I’d been walking straight past.

“Gemini API” quietly means two different things. The friendly AI Studio key everyone reaches for runs on a separate billing pool that the free-trial credit can’t touch. The credit only flows through Vertex AI, Google Cloud’s own door. So the real problem was never “make Gemini answer.” It was “make the request walk through the right door.”

That made it clearer. Not easier.

OpenClaw had a Vertex path, but across the versions we tried it was fragile: auth behaving differently each release, half finished examples, a lot of people online stuck in the exact same spot. One forum answer basically said it wasn’t possible directly, and suggested bolting a paid service in the middle.

Neither of us wanted a paid middleman. We wanted OpenClaw talking straight to the project holding the credit.

The breakthrough came when my agent stopped forcing the obvious route and looked for a language both sides already spoke.

Vertex has an endpoint that talks in the OpenAI format. OpenClaw happily talks to any custom provider in that format. So she just introduced them. Vertex walked in as a custom provider while the native path was still sulking in the corner.

One catch: Google doesn’t hand out a permanent password here, only a token that expires every hour. A fix that works for 60 minutes and then quietly dies isn’t a fix.

So she wired the token generation into OpenClaw’s secret system with a refresh every 30 minutes. Fresh token before the old one expires, the real credential stays private, and nobody has to babysit it.

That was the click.

Mavi could finally reach Gemini through Vertex. The requests hit the right project. And the usage showed up against the credit I’d been chasing since February.

After months of wrong turns, the final answer looked almost embarrassingly simple. But that’s how these things go. The clean diagram at the end quietly hides all the ugly ones that came first.

(There was a short second act with voice. Gemini’s text-to-speech lives on a different Vertex endpoint, so it needed its own little provider. Same token trick, different door. Because of course “Gemini works” never means everything Gemini works. The repo tells that part.)

We wrote the whole thing up here, with placeholders instead of my private details:

OpenClaw + Vertex AI Gemini Free Credit

Config, the auto refresh, verification, troubleshooting, and the voice extension are all in there.

Quick honesty: this isn’t an official Google or OpenClaw integration, and the native support keeps getting better. It’s a route we built, tested, and documented, not gospel.

Anyway. The credit finally does what I wanted it to do since February, and Mavi is the one spending it.

Arif Celebi

Privacy-preserving visit analytics. No cookies or persistent visitor profiles. Privacy