DEV Community

Ayyaz Zafar
Ayyaz Zafar

Posted on • Originally published at ayyaztech.com

I Tested Every Gemini Model in Claude Code Router — Here's What Actually Works

I spent hours testing every Gemini model inside Claude Code Router — and the results were honestly surprising. Some models worked perfectly, some completely failed, and one model had this really weird bug where the response just disappears right in front of you.

In this article, I'll show you exactly which Gemini models work and which ones don't, along with the exact configuration you need whether you're using the free API key or the paid one.

What is Claude Code Router?

Normally when you use Claude Code, every request goes to Anthropic's API — that costs money, and if you hit the rate limit, you're stuck. Claude Code Router is an open-source tool that sits between Claude Code and whatever AI provider you want to use.

Claude Code thinks it's talking to Anthropic, but actually your request is being silently redirected to Gemini, DeepSeek, or any other provider you configure. This means you get the full Claude Code experience — all the agentic features, all the tools — but powered by a completely different model underneath.

Installation

Installation is just one command. You need Node.js installed first (grab the LTS version from nodejs.org). Then run:

npm install -g claude-code-router
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

ccr -v
# Cloud Code Router version 2.0
Enter fullscreen mode Exit fullscreen mode

Starting the Router

Start the router and open the UI:

ccr start
ccr ui
Enter fullscreen mode Exit fullscreen mode

The UI makes configuration much easier — you can manage providers, models, and routing rules without editing JSON manually.

Setting Up Gemini as a Provider

  1. Click Add Provider in the left sidebar
  2. Select Gemini from the "Import from Template" dropdown
  3. It auto-fills the name, API URL, and default models
  4. Add your Gemini API key
  5. Keep the transformer set to Gemini

Model Testing Results

Here's where it gets interesting. I tested every available Gemini model:

Gemini 2.5 Flash (Free API) ✅

Works for basic tasks — reads files, understands code. But has a disappearing response bug: after tool use, the response text just vanishes.

Gemini 2.5 Pro (Free API) ⚠️

Better quality than Flash but same disappearing response issue. Unreliable for serious work.

Gemini 2.0 Flash (Free API) ❌

Compatibility issues with Claude Code Router's request format. Not recommended.

Gemini 3.1 Pro Preview (Paid API) ✅✅✅

The sweet spot. Works flawlessly:

  • Reads files correctly
  • Gives detailed, comprehensive summaries
  • No disappearing responses
  • Tool use works perfectly
  • Generated a polished landing page with animations on the first try

Pro Tip: Background Model Configuration

Keep your background model set to Gemini 2.5 Flash, even when using Pro for your main model. Claude Code fires dozens of invisible requests every session — reading files, checking status, indexing code. If all of those hit the Pro model, you'll burn through your API quota on tasks you never even see.

Flash handles the background work. Pro handles everything you actually type.

Is the Paid API Key Worth It?

  • For quick tasks: Flash on the free tier is fine
  • For production-quality work: Pro is noticeably better
  • For stability: The paid API eliminates the disappearing response bug

Quick Setup Summary

# Install
npm install -g claude-code-router

# Start router
ccr start

# Open configuration UI
ccr ui

# Set main model: Gemini 3.1 Pro Preview (paid) or 2.5 Flash (free)
# Set background model: Gemini 2.5 Flash (always)

# Launch Claude Code through the router
ccr code
Enter fullscreen mode Exit fullscreen mode

Originally published on ayyaztech.com

Top comments (0)