Free LLM API fallback: Groq → Gemini → OpenRouter

Last verified: 2026-10-10

One free key runs out fast. All three providers speak the OpenAI API, so when one returns 429, send the same request to the next base URL. Copy this order:

# Try in order; on HTTP 429 move to the next provider
GROQ_BASE_URL=https://api.groq.com/openai/v1
GROQ_MODEL=openai/gpt-oss-120b

GEMINI_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai/
GEMINI_MODEL=gemini-3.8-flash

OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
OPENROUTER_MODEL=openrouter/free

1. Create three free keys

  1. Groq — OpenAI-compatible, fast GPT-OSS and Qwen3.8 (~30 RPM , 1000 req/day )
  2. Google AI Studio — Gemini 3.8 Flash free tier (2.5 models are limited to existing users) (Google no longer publishes fixed free-tier RPM/RPD. Your project's limits are shown in AI Studio → Usage & limits.)
  3. OpenRouter — one key for many :free routes (~20 RPM , 50 req/day before credits )

Full numbers live on the free API comparison table and each provider page.

2. Suggested routing

WorkloadPrimaryFallback
Fast chat / coding assistants Groq (GPT-OSS 120B) OpenRouter :free
Vision / long multimodal context Gemini Flash OpenRouter multimodal :free route if available
Try new open models OpenRouter :free Groq if the model is hosted there
Offline / private Ollama local —

3. Wire the keys into your editor

Keep each key in env vars (GROQ_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY). When you hit 429, switch provider instead of retrying in a tight loop.

4. Know when free is not enough

Free stacks are for prototyping and light daily use. For multi-user serving, move to a GPU VPS with vLLM on Linux or keep a local Ollama + Cursor path.

FAQ

Which free LLM API should I start with?
Start with Groq for speed and clear RPM/daily limits on GPT-OSS and Qwen3.8. Add Gemini for multimodal Flash, then OpenRouter for many :free open models behind one key.
Can I use Groq, OpenRouter, and Gemini together for free?
Yes. Create one free key per provider and route different workloads to each. Keep an eye on each provider’s free RPM and daily caps on our comparison table.
What happens when I hit a free-tier rate limit?
Switch to another key in your stack, fall back to a local Ollama model, or wait for the daily window to reset. Do not put free keys in production without retries and backoff.

← Free API guides · Compare providers · Get started