Use Gemini models in Claude Code

Run Claude Code on Gemini 4 Argon, with Gemini 3.8 Flash for small jobs, through Claude Code Router and /model.

Checked November 28, 2026

Claude Code speaks Anthropic's Messages format. Gemini models answer on OpenAI's chat completions API instead, so Claude Code needs Claude Code Router in between to translate. This page gives the router's choices for Gemini. We ran it with Claude Code 2.1.332 and Claude Code Router 3.1.6 against /model, on 28 Nov 2026.

Before you start

Set it up

Install Claude Code Router and go through its setup wizard as the Claude Code Router guide shows, with these choices:

  1. Choose provider: name the provider slashmodel-chat, with the API endpoint below.
  2. Pick models: click Gemini 4 Argon and Gemini 3.8 Flash.
  3. Verify connection: under Advanced settings, switch off Auto detect protocols and leave only OpenAI Chat ticked. In the check, each model should come back as Connection verified.
  4. Connect agent: set Default model to slashmodel-chat/gemini-4-argon and Haiku model to slashmodel-chat/gemini-3.8-flash. Leave the other model fields on Keep Claude Code default.

API endpoint

https://api.slashmodel.com/v1

When the wizard ends, start Claude Code through the router, with the profile's name:

bash
ccr sm

Router already set up for GPT models? Gemini goes on a second provider: the router guide shows how. Then start a session on Gemini by naming it: ccr sm -- --model slashmodel-chat/gemini-4-argon.

Pick a model

  • Gemini 4 Argon, gemini-4-argon: the default model in the steps above.
  • Gemini 3.8 Flash, gemini-3.8-flash: the Haiku model. It costs less than Argon.

We ran Claude Code on these two. The pricing page lists the other Gemini models, and each model's price.

Claude Code's haiku name gets the profile's Haiku model, so this session runs on Gemini 3.8 Flash. Claude Code also uses that model for small jobs in the background.

bash
ccr sm -- --model haiku

Good to know

  • Gemini needs OpenAI Chat. Gemini models aren't on the Responses API, so they can't share a provider set up for GPT models.
  • Part of the prompt is read from the cache. Claude Code sends its long instructions again with every request. In our run on Gemini 4 Argon, a small task of three requests read nearly half of its prompt tokens from the cache, at the cache price.
  • The router's check waits 10 seconds for each model. A model that takes longer shows as Unavailable, with "This operation was aborted".
  • Claude Code warns that it doesn't recognise the model's name, then goes on: in our runs it wrote a file and ran it, as it does on Claude.
  • A key can cap what a session costs. Give Claude Code a key of its own with a daily or monthly limit: see key settings.
  • Every request shows under Usage with its model, its tokens and its cost.

One key for every model here.

Top up from $10, change one URL, and pay only for the tokens you use.