DEV Community

Fayaz Bin Salam
Fayaz Bin Salam

Posted on

rotato: zero-dependency node proxy that rotates LLM API keys on 429

running multiple LLM providers — openai, gemini, groq, openrouter — and constantly hitting rate limits is annoying. i built rotato to solve exactly that.

it's a node.js proxy server that sits in front of your LLM API calls. when a 429 hits, it rotates to the next available key automatically. zero restarts, zero manual intervention, zero external npm dependencies.

what it does

point your existing code at localhost:8990/your-provider/ instead of the real API endpoint. rotato proxies the request, and if a key returns a 429 (or any status code you configure), it immediately retries with the next key in the pool.

the whole thing runs on node's built-in http module — no express, no axios, no nothing. clone, set two env vars, run.

features

  • any openai/gemini-compatible API — groq, openrouter, together.ai, anthropic, etc.
  • streaming (SSE) — full pass-through, no buffering
  • smart rotation — tracks recently failed keys, avoids them temporarily
  • live key validation — tests keys before saving
  • hot config — add, edit, disable providers/keys without restarting
  • per-key usage tracking — counts visible in admin panel
  • request log — last 100 requests with which key succeeded/failed
  • file logging — all requests to logs.jsonl with debounced batched writes

admin panel

dark/light themed UI at /admin. reorder keys for rotation priority, disable individual keys, generate pre-filled curl commands per provider.

telegram bot

wire up a bot token from the admin panel — chat with any configured model from telegram. text, image input, image generation — all routed through the proxy.

quick start

git clone https://github.com/p32929/rotato.git
cd rotato && cp .env.example .env
# set PORT and ADMIN_PASSWORD
npm start
Enter fullscreen mode Exit fullscreen mode

open http://localhost:8990/admin, add providers, paste keys, done.

https://github.com/p32929/rotato — MIT licensed, 60 stars.

feedback welcome, especially if you've handled the same problem differently. stars/forks appreciated.

open to building with sharp teams and solo founders — dms/email open.

Top comments (0)