0%
Loading ...

How to run gemini llm with claude coding agent in vs code

  1. Get API KEY
  2. Open power shell
  3. Paste the following:
# 1. Set up the loopback variable to pass your Gemini Key directly into the Anthropic slot
$env:ANTHROPIC_API_KEY="[your own key]"

# 2. Tell Claude Code to redirect its traffic to Google's native generative API endpoint
$env:ANTHROPIC_BASE_URL="https://googleapis.com"

# 3. Inform the environment of your base execution model parameter override
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="gemini-2.5-flash"

Write-Host "🚀 Rerouting Claude Code pipeline directly to Gemini endpoints..." -ForegroundColor Cyan
Start-Sleep -Seconds 1

# 4. Clear old session state freezes and start VS Code cleanly
Write-Host "💻 Booting workspace..." -ForegroundColor Green
code .

3. This will open vs code

4. Make sure you have also claude extension installed.

5. In the claude extension write there “/switch model” and select gemini