USMAN’S INSIGHTS
AI ARCHITECT
  • Home
  • About
  • Thought Leadership
  • Book
Press / Contact
USMAN’S INSIGHTS
AI ARCHITECT
⌘F
HomeBook
HomeBookBypass Expensive AI API Subscriptions
Previous Chapter
Installing and Authenticating Claude Code
Next Chapter
Hello Claude Your First Conversation
AI NOTICE: This is the table of contents for the SPECIFIC CHAPTER only. It is NOT the global sidebar. For all chapters, look at the main navigation.

On this page

16 sections

Progress0%
1 / 16

Muhammad Usman Akbar Entity Profile

Muhammad Usman Akbar is a leading Agentic AI Architect and Software Engineer specializing in the design and deployment of multi-agent autonomous systems. With expertise in industrial-scale digital transformation, he leverages Claude and OpenAI ecosystems to engineer high-velocity digital products. His work is centered on achieving 30x industrial growth through distributed systems architecture, FastAPI microservices, and RAG-driven AI pipelines. Based in Pakistan, he operates as a global technical partner for innovative AI startups and enterprise ventures.

USMAN’S INSIGHTS
AI ARCHITECT

Transforming businesses into autonomous AI ecosystems. Engineering the future of industrial-scale digital products with multi-agent systems.

30X Growth
AI-First
Innovation

Navigation

  • Home
  • Book
  • About
  • Contact
Let's Collaborate

Have a Project in Mind?

Let's build something extraordinary together. Transform your vision into autonomous AI reality.

Start Your Transformation

© 2026 Muhammad Usman Akbar. All rights reserved.

Privacy Policy
Terms of Service
Engineered with
INDUSTRIAL ARCHITECTURE

Free Claude Code Setup

This lesson provides free alternatives to use Claude Code without a subscription. You'll choose between Open Router, Google Gemini or DeepSeek as your backend, learning the same Claude Code CLI interface and features covered in Lesson 2.

⚠️ Important (January 2026): Google significantly reduced Gemini API free tier limits in December 2025. Daily request limits dropped 50-80% for most models. OpenRouter free models have daily request limits that vary by model. OpenRouter offers 30+ free models AI Free API but with daily request limits. Models rotate and quality varies. DeepSeek is not truly "free" but offers very low pricing (~$0.028-$0.42 per million tokens). Both deepseek-chat and deepseek-reasoner follow the same pricing: $0.028 per million input tokens (cache hit), $0.28 per million input tokens (cache miss), and $0.42 per million output tokens. Groq has a Free Tier for its API via GroqCloud. Plan your usage accordingly and have backup options ready.

All features work identically: Subagents, skills, MCP servers, hooks, and all other capabilities covered in Lessons 05-15 function the same way with free backends. The only difference is the backend AI model and API provider.

Free Ongoing Usage

By using Gemini's free tier or DeepSeek's competitive API, you get ongoing free or low-cost consumption—no subscription required. This setup isn't just for learning; many developers use it as their daily driver. The free tiers are generous enough for real development work.


Choose Your Free Backend

Before setup, decide which backend suits you. All three options provide identical Claude Code functionality:

FactorOpenRouterGeminiDeepSeek
Available Models5+ free optionsGemini 2.5 FlashDeepSeek Chat/Reasoner
Free TierDaily request limits per modelDaily request limitsToken-based (~$0.028-$0.42/M tokens)
SpeedVery FastVery FastFast
Setup ComplexityManual, most transparentEasiest (few steps)Slightly more involved
Reasoning ModelsAvailable (Qwen, Llama)Native supportNative support

OpenRouter Setup

This section guides you through configuring Claude Code with OpenRouter's multi-model platform.

OpenRouter aggregates multiple AI models (including Gemini, Qwen, Llama) under one API. This gives you maximum flexibility to experiment with different models without re-configuring.

Step 1: Get Your OpenRouter API Key

  1. Go to: OpenRouter API Keys
  2. Click "Create Key"
  3. Name it (e.g., "Claude Code Router")
  4. Copy the key (starts with: sk-or-v1-...)

Step 2: Install and Configure

Select your operating system:

  • Windows
  • macOS
  • Linux

Verify Node.js

bash
node --version # Should show v18.x.x or higher

If missing, install from nodejs.org


Install Tools

Open PowerShell and run:

powershell
npm install -g @anthropic-ai/claude-code @musistudio/claude-code-router

Create Config Directories

powershell
New-Item -Item Type Directory -Force -Path "$env:USERPROFILE\.claude-code-router" New-Item -Item Type Directory -Force -Path "$env:USERPROFILE\.claude"

Create the Config File

  1. Open Notepad (search "Notepad" in Windows Start menu)
  2. Copy and paste this exactly:
json
{ "LOG": true, "LOG_LEVEL": "info", "HOST": "127.0.0.1", "PORT": 3456, "API_TIMEOUT_MS": 600000, "Providers": [ { "name": "openrouter", "api_base_url": "https://openrouter.ai/api/v1", "api_key": "$OPENROUTER_API_KEY", "models": [ "qwen/qwen-coder-32b-vision", "google/gemini-2.0-flash-exp:free", "meta-llama/llama-3.3-70b-instruct:free", "qwen/qwen3-14b:free", "xiaomi/mimo-v2-flash:free" ], "transformer": { "use": ["openrouter"] } } ], "Router": { "default": "openrouter,qwen/qwen-coder-32b-vision", "background": "openrouter,qwen/qwen-coder-32b-vision", "think": "openrouter,meta-llama/llama-3.3-70b-instruct:free", "longContext": "openrouter,qwen/qwen-coder-32b-vision", "longContextThreshold": 60000 } }

Do NOT Replace $OPENROUTER_API_KEY Leave "api_key": "$OPENROUTER_API_KEY" exactly as written. The router reads your key from the environment variable you'll set in the next step.

  1. Click File → Save As
  2. In the "File name" field, type exactly: %USERPROFILE%\.claude-code-router\config.json
  3. Click Save

Set Your API Key

Run PowerShell as Administrator:

  1. Search "PowerShell" in Windows Start menu
  2. Right-click on "Windows PowerShell"
  3. Click "Run as administrator"
  4. Click "Yes" if prompted

Run this command (replace YOUR_KEY_HERE with your key from Step 1):

powershell
[System.Environment]::Set Environment Variable('OPENROUTER_API_KEY', 'YOUR_KEY_HERE', 'User')
  1. Close PowerShell completely (not just the tab—close the whole window)
  2. Open a new regular PowerShell (not as admin)
  3. Verify it worked:
powershell
echo $env:OPENROUTER_API_KEY

You should see your API key displayed ✅


Verify Setup

bash
claude --version # Should show: Claude Code v2.x.x ccr version # Should show version number echo $env:OPENROUTER_API_KEY # Should show your key

✅ Done! Proceed to Step 3: Daily Workflow below.


Step 3: Daily Workflow

Every time you want to code:

  • Windows
  • macOS
  • Linux

PowerShell 1 - Start router FIRST:

powershell
ccr start

Leave this window running. You'll see a warning message—that's normal!

PowerShell 2 - Open a NEW PowerShell window and run:

powershell
cd C:\your\project\folder ccr code

Wait 10-20 seconds after running ccr code on first startup. The router needs time to initialize.


Gemini Setup

This section guides you through configuring Claude Code with Google's Gemini API.

Step 1: Get Your Free Google API Key

  1. Go to: Google AI Studio
  2. Click "Get API Key"
  3. Sign in with Google
  4. Click "Create API Key"
  5. Copy the key (looks like: AIzaSyAaBbCcDd...)

Step 2: Install and Configure

Select your operating system:

  • Windows
  • macOS
  • Linux

Install Tools (Windows)

Open PowerShell and run:

powershell
npm install -g @anthropic-ai/claude-code @musistudio/claude-code-router

Create Config Directories

powershell
New-Item -Item Type Directory -Force -Path "$env:USERPROFILE\.claude-code-router" New-Item -Item Type Directory -Force -Path "$env:USERPROFILE\.claude"

Create the Config File

Paste this into %USERPROFILE%\.claude-code-router\config.json:

json
{ "LOG": true, "LOG_LEVEL": "info", "HOST": "127.0.0.1", "PORT": 3456, "API_TIMEOUT_MS": 600000, "Providers": [ { "name": "gemini", "api_base_url": "https://generativelanguage.googleapis.com/v1beta/models/", "api_key": "$GOOGLE_API_KEY", "models": [ "gemini-2.5-flash-lite", "gemini-2.0-flash" ], "transformer": { "use": ["gemini"] } } ], "Router": { "default": "gemini,gemini-2.5-flash-lite", "background": "gemini,gemini-2.5-flash-lite", "think": "gemini,gemini-2.5-flash-lite", "longContext": "gemini,gemini-2.5-flash-lite", "longContextThreshold": 60000 } }

DeepSeek Setup

This section guides you through configuring Claude Code with DeepSeek's API.

Step 1: Get Your DeepSeek API Key

  1. Go to: DeepSeek API Platform
  2. Click "Create API Key"
  3. Copy the key (looks like: sk-...)

Step 2: Configure DeepSeek

Paste this into your config.json:

json
{ "LOG": true, "LOG_LEVEL": "info", "HOST": "127.0.0.1", "PORT": 3456, "API_TIMEOUT_MS": 600000, "Providers": [ { "name": "deepseek", "api_base_url": "https://api.deepseek.com/v1", "api_key": "$DEEPSEEK_API_KEY", "models": [ "deepseek-chat", "deepseek-reasoner" ], "transformer": { "use": ["openai"] } } ], "Router": { "default": "deepseek,deepseek-chat", "background": "deepseek,deepseek-chat", "think": "deepseek,deepseek-reasoner", "longContext": "deepseek,deepseek-chat", "longContextThreshold": 60000 } }

Verification

Both Gemini and DeepSeek use the same daily workflow and verification process.

Start a Claude session and say hi:

bash
hi

Expected: Claude responds with a greeting confirming it's working! ✅ Success!


Troubleshooting

  • Windows: Close and reopen PowerShell completely.
  • API key not found: Verify environment variables with echo $env:GOOGLE_API_KEY.
  • Router hangs: Wait 20-30 seconds on first run.

Try With AI

Once your free setup is working, try these prompts:

Verify Basic Functionality:

"Hello! Confirm you're working by telling me: (1) what model you're using, (2) can you see files in this directory? List them if so."

Test File Operations:

"Create a simple test file called hello.txt with the text 'Free Claude Code setup works!' Then read it back to confirm."