@theroshankrishna
@theroshankrishna
FREE CLAUDE CODE
SETUP GUIDE
Run Claude Code for free using Google Antigravity + OpenRouter
No Anthropic subscription needed. No complex terminal setup.
Just paste one prompt, grab a free API key, and start building.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
What Is This?
Claude Code is Anthropic's powerful AI coding assistant that runs in your terminal. It can write
code, debug errors, refactor files, and build entire projects — all from a text prompt.
The problem? It normally costs money. You either need a Claude Pro subscription or pay per
API call.
The hack: You can redirect Claude Code to use free AI models through a service called
OpenRouter. And you can do all of this inside Google Antigravity — a free IDE with a built-in
terminal and AI chat.
What You Need
1. Google Antigravity (free) — Google's AI-powered IDE
Download: [Link]
2. OpenRouter Account (free) — API gateway with free AI models
Sign up: [Link]
3. 5 minutes of your time. That's it.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
Step 1: Install Claude Code Extension
Open Google Antigravity on your computer.
1. Click on the Extensions icon in the left sidebar (or press Ctrl+Shift+X).
2. Search for "Claude Code" in the extensions marketplace.
3. Click Install.
4. Once installed, you'll see the Claude Code icon in your sidebar.
Why Antigravity?
Antigravity has a built-in terminal + AI chat. So you can run the setup prompt directly inside the IDE
without switching between apps. Plus it's completely free.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
Step 2: Paste the Setup Prompt
Open Antigravity's built-in AI chat (usually on the right side panel). Copy the entire prompt below
and paste it into the chat.
The Prompt — Copy Everything Below
## Task
Configure Claude Code to use OpenRouter as its API backend so I can
use free AI models for coding without paying for an Anthropic subscription.
## What You Need to Do
Create or update the file ~/.claude/[Link] with the following
environment variables that redirect Claude Code's API requests to OpenRouter.
## My Details
- OpenRouter API Key: [PASTE YOUR KEY HERE]
- Model: [PASTE MODEL ID HERE — see free models list below]
## Step 1: Create the config directory
Run: mkdir -p ~/.claude
## Step 2: Write the settings file
Create or update ~/.claude/[Link] with this exact content:
{
"env": {
"ANTHROPIC_BASE_URL": "[Link]
"ANTHROPIC_AUTH_TOKEN": "[MY OPENROUTER API KEY]",
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_MODEL": "[MY MODEL ID]"
},
"model": "sonnet[1m]"
}
## Critical Rules (DO NOT break these)
1. ANTHROPIC_BASE_URL must be exactly "[Link]
— do NOT append /v1 (Claude Code adds it automatically).
2. API key goes in ANTHROPIC_AUTH_TOKEN, NOT in ANTHROPIC_API_KEY.
ANTHROPIC_API_KEY must be an empty string "" to prevent Claude
Code from trying to authenticate with Anthropic directly.
3. Do NOT modify ~/.zshrc, ~/.bashrc, or any shell config file.
The [Link] "env" block is the only correct place.
4. Do NOT remove "model": "sonnet[1m]". It is required for Claude
Code to start. It does NOT control which AI model you use.
5. The JSON must be valid — no trailing commas, no comments.
6. Do NOT test the API connection by running curl or making any
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
API request. Settings only take effect when Claude Code starts
a new session. Testing from the current session will fail.
7. Do NOT add extra fields like effortLevel, preferences, or
skipDangerousModePermissionPrompt. Only use the keys shown above.
## Step 3: Verify the file
Read back ~/.claude/[Link] and confirm:
- ANTHROPIC_BASE_URL ends with /api (NOT /api/v1)
- ANTHROPIC_AUTH_TOKEN has the full key (starts with sk-or-)
- ANTHROPIC_API_KEY is exactly "" (empty string, not missing)
- ANTHROPIC_MODEL has the correct model ID
- "model": "sonnet[1m]" is present at the top level
## Step 4: Tell me it is done
Tell me: Setup is complete. Quit this terminal completely and
open a new terminal window. Run 'claude' to start.
Don't edit the prompt yet!
You'll paste your API key and model ID in the next steps. For now, just paste the prompt as-is into
Antigravity's chat. The AI will set everything up for you.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
Step 3: Get Your Free OpenRouter API Key
1. Go to [Link] and create a free account (Google sign-in works).
2. Click on Keys in the left sidebar (or go to [Link]/keys).
3. Click "Create Key" and give it a name (like "Claude Code").
4. Copy the key immediately. It starts with sk-or- and you won't see it again after you close
the popup.
Choose a Free Model
Go to [Link]/models and filter by "Free" models. Here are the best free models for coding
as of June 2026:
Best Free Models for Coding
google/gemma-3-27b-it:free Google Gemma 3 — solid all-rounder
deepseek/deepseek-chat-v3-0324:free DeepSeek V3 — excellent for code generation
qwen/qwen3-235b-a22b:free Qwen 3 235B — huge model, great reasoning
nvidia/llama-3.3-nemotron-super-49b-v1:free NVIDIA Nemotron — strong at debugging
meta-llama/llama-4-maverick:free Meta Llama 4 Maverick — fast and capable
Copy the model ID exactly as shown — these are case-sensitive.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
Step 4: Replace Placeholders and Run
Before the AI runs the prompt, it will ask you for two things. Here's what to paste:
1. Where it says [PASTE YOUR KEY HERE] — paste your OpenRouter API key (the one
starting with sk-or-).
2. Where it says [PASTE MODEL ID HERE] — paste the model ID from the list above (e.g.
google/gemma-3-27b-it:free).
The AI will automatically:
• Create the config directory (~/.claude)
• Write the [Link] file with your key and model
• Verify everything is correct
• Tell you it's done
After Setup is Done
1. Quit your current terminal completely (not just close the tab — fully quit).
2. Open a brand new terminal window.
3. Type claude and press Enter.
4. You should see your chosen model name in the startup output. You're in.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
Step 5: Switch Between Models (Optional)
Want to try a different model? You have two options:
Option A: Change the Default Model
Open ~/.claude/[Link] and change the ANTHROPIC_MODEL value to a different model
ID. Save, quit terminal, reopen, run claude.
Option B: Use Multiple Models
You can configure Claude Code to let you switch between models. Update your [Link]
like this:
{
"env": {
"ANTHROPIC_BASE_URL": "[Link]
"ANTHROPIC_AUTH_TOKEN": "sk-or-your-key-here",
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_MODEL": "google/gemma-3-27b-it:free",
"ANTHROPIC_DEFAULT_SONNET_MODEL":
"deepseek/deepseek-chat-v3-0324:free",
"ANTHROPIC_DEFAULT_OPUS_MODEL":
"qwen/qwen3-235b-a22b:free",
"ANTHROPIC_DEFAULT_HAIKU_MODEL":
"nvidia/llama-3.3-nemotron-super-49b-v1:free"
},
"model": "sonnet[1m]"
}
This lets you switch between models inside Claude Code using the /model command without
editing the file every time.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
Step 6: Use in Terminal (Without Antigravity)
If you want to run Claude Code directly in your regular terminal (outside Antigravity), you need
to install it first:
Install Claude Code CLI
curl -fsSL [Link] | bash
Then add it to your PATH (so your terminal can find the 'claude' command):
For Mac/Linux (zsh):
echo 'export PATH="$HOME/.local/bin:$PATH"'
>> ~/.zshrc && source ~/.zshrc
For Linux (bash):
echo 'export PATH="$HOME/.local/bin:$PATH"'
>> ~/.bashrc && source ~/.bashrc
The [Link] file you created in Step 2 works everywhere — both inside Antigravity and in
your regular terminal. You don't need to set it up again.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
Troubleshooting
"Model not found" error
The model ID is wrong or the model was removed. Go to [Link]/models, find the model,
and copy the exact ID. Model IDs are case-sensitive.
429 Rate Limit Error
Free models have usage limits: roughly 50 requests/day and 20 requests/minute. Wait 60
seconds and try again. If it keeps happening, you've hit the daily limit — try again tomorrow or
switch to a different free model.
"Invalid API key" error
Make sure your API key is in ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY). The
key should start with sk-or-. Double check you copied the full key.
Claude Code still asks me to log in
ANTHROPIC_API_KEY is either missing from [Link] or has a non-empty value. It MUST
be present and set to exactly "" (an empty string).
Settings don't seem to work
You need to quit your terminal completely (not just close the tab) and open a brand new window.
Settings only load when Claude Code starts fresh.
The JSON file has errors
Common mistakes: trailing commas after the last item, missing quotes around keys, or
accidentally deleting a bracket. Paste your [Link] into [Link] to find the error.
Important Notes
• Free models are not Claude. You're using Gemma, DeepSeek, Llama etc. through Claude
Code's interface. They're good but not identical to Claude Sonnet/Opus.
• Rate limits exist. Free tier = ~50 requests/day, 20/minute. For heavier use, deposit $5-10
on OpenRouter to unlock higher limits (still way cheaper than Anthropic direct).
• Models change. Free models on OpenRouter can be added or removed. Check
[Link]/models for the latest free options.
@theroshankrishnaFree Claude Code Setup Guide
@theroshankrishna
• This is legit. OpenRouter is an official API gateway. Claude Code supports custom API
endpoints. You're not hacking anything — just redirecting where the requests go.
Made by @theroshankrishna
Follow for more AI tools, prompts, and career hacks.
Comment 'CODE' on the reel to receive this guide.
@theroshankrishnaFree Claude Code Setup Guide