image

Yeah me too. If you’re seeing this you’re one of the cheapskates like me who likes vibe-coding with Cline with Google’s free Gemini API. And if you’ve seen these you’ve definitely have a handful of API keys that you swap out every once in a while. It gets tedious fast, and you probably want an auto key rotator in Cline. It’s actually one of the most requested features but they haven’t implemented it yet.

Well I don’t have something like that, but I have the next best thing: a relay server that contains all your API keys, sitting between your Cline and Google API endpoint, and swap out a new key in a round-robin fashion when there’s requests.

TLDR: here’s the Github repo

https://github.com/vnt87/geminiproxy-worker/

This is my first opensource non front-end project.

To be clear, this wasn’t my original idea. I found a project by Chakshu Gautam that implement this proxy server but written in Go. It is pretty cool and is deployable via Docker, and I’m sure a lot of folks over on r/selfhosted are going to love that.

But I already have 50+ containers on my poor mini server at home that also doubles as my wife’s HTPC. So I set out to adapt that Go-based project into JS/TS so they can be deployed as a Worker via Cloudflare’s Edge Computing infrastructure. I recently had to deploy a similar Worker project that acts as a API relay server for Telegram so my n8n bots can continue to operate after our very competent administration decided to ban it out of nowhere.

0 0 votes
Article Rating