Skip to content

keepuahead/custom-claude-code

Repository files navigation

πŸš€ Free Claude Code - Easiest Way to Use Claude Code with ANY API

License: MIT One-Line Install

⚑ The EASIEST setup to use Claude Code with custom API endpoints. One command. Done.


🎯 One-Line Installation

Windows (PowerShell) - Run as Administrator

irm https://raw.githubusercontent.com/keepuahead/custom-claude-code/main/install.ps1 | iex

Mac/Linux

curl -fsSL https://raw.githubusercontent.com/keepuahead/custom-claude-code/main/install.sh | bash

Install with NPM (Alternative)

npm install -g @anthropic-ai/claude-code@2.0.64 && npm install -g @keepuahead/free-claude-code && fcc start

Or Install from Source

# Clone and install
git clone https://github.com/keepuahead/custom-claude-code.git
cd custom-claude-code
pnpm install && pnpm build
npm link

# Install Claude Code
npm install -g @anthropic-ai/claude-code@2.0.64

⚑ Quick Setup (30 Seconds)

Step 1: Create Config File

Create ~/.free-claude-code/config.json:

Windows: C:\Users\YOUR_NAME\.free-claude-code\config.json Mac/Linux: ~/.free-claude-code/config.json

{
  "Providers": [{
    "name": "myapi",
    "api_base_url": "https://freeaiapikey.com/v1/chat/completions",
    "api_key": "YOUR_API_KEY",
    "models": ["gpt-5", "claude-sonnet-4.5"]
  }],
  "Router": { "default": "myapi,gpt-5" }
}

Step 2: Run!

fcc code

That's it! You're now using Claude Code with your custom API. πŸŽ‰


🌟 Popular Providers

FreeAIAPIKey.com (Recommended - 80% Cheaper!)

{
  "Providers": [{
    "name": "freeaiapikey",
    "api_base_url": "https://freeaiapikey.com/v1/chat/completions",
    "api_key": "YOUR_KEY",
    "models": ["gpt-5", "claude-sonnet-4.5", "gemini-3", "deepseek-chat"]
  }],
  "Router": { "default": "freeaiapikey,gpt-5" }
}

πŸ‘‰ Get $2 FREE credit at freeaiapikey.com

DeepSeek

{
  "Providers": [{
    "name": "deepseek",
    "api_base_url": "https://api.deepseek.com/chat/completions",
    "api_key": "YOUR_KEY",
    "models": ["deepseek-chat"]
  }],
  "Router": { "default": "deepseek,deepseek-chat" }
}

OpenRouter

{
  "Providers": [{
    "name": "openrouter",
    "api_base_url": "https://openrouter.ai/api/v1/chat/completions",
    "api_key": "YOUR_KEY",
    "models": ["anthropic/claude-sonnet-4"]
  }],
  "Router": { "default": "openrouter,anthropic/claude-sonnet-4" }
}

OpenAI

{
  "Providers": [{
    "name": "openai",
    "api_base_url": "https://api.openai.com/v1/chat/completions",
    "api_key": "YOUR_KEY",
    "models": ["gpt-5", "gpt-4o"]
  }],
  "Router": { "default": "openai,gpt-5" }
}

Any OpenAI-Compatible API

{
  "Providers": [{
    "name": "custom",
    "api_base_url": "https://YOUR-API-URL/v1/chat/completions",
    "api_key": "YOUR_KEY",
    "models": ["your-model"]
  }],
  "Router": { "default": "custom,your-model" }
}

πŸ“‹ Commands

Command Description
fcc code πŸš€ Start coding with Claude
fcc start ▢️ Start router server
fcc stop ⏹️ Stop router server
fcc status πŸ“Š Show server status
fcc model πŸ”„ Switch model interactively
fcc ui 🌐 Open web config UI
fcc help ❓ Show all commands

πŸ’° Save 80% with FreeAIAPIKey.com

Model Official Price Our Price You Save
GPT-5 $1.25/1M tokens $0.25/1M 80%
Claude Sonnet 4.5 $3/1M tokens $0.60/1M 80%
Claude Opus 4.5 $5/1M tokens $1/1M 80%
Gemini 3 $2/1M tokens $0.40/1M 80%
DeepSeek V3.2 $0.50/1M tokens $0.20/1M 60%

🎁 Get $2 FREE Credit β†’ freeaiapikey.com

No credit card required β€’ No rate limits β€’ Instant access


πŸ”§ How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Claude Code β”‚ ──► β”‚ Free Claude Code β”‚ ──► β”‚ Your API (80%   β”‚
β”‚   (You)     β”‚     β”‚    (Router)      β”‚     β”‚   cheaper!)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. You run fcc code instead of claude
  2. Free Claude Code routes requests to YOUR API
  3. Works with ANY OpenAI-compatible endpoint
  4. Save up to 80% on API costs!

❓ FAQ

Why do I need Claude Code v2.0.64?

Claude Code v2.0.64 has the best compatibility with custom API routers. Newer versions may have issues.

Can I use any OpenAI-compatible API?

Yes! Just set your api_base_url and api_key. Works with:

  • FreeAIAPIKey.com
  • DeepSeek
  • OpenRouter
  • OpenAI
  • Gemini
  • Groq
  • Ollama (local)
  • Any custom endpoint
How do I switch models?

Inside Claude Code, type:

/model provider,model-name

Example: /model freeaiapikey,claude-sonnet-4.5

Is my data safe?

Yes! Free Claude Code runs locally on your machine. Your API key never leaves your computer.


πŸ› Troubleshooting

Server won't start

fcc stop && fcc start

Config file location

  • Windows: C:\Users\YOUR_NAME\.free-claude-code\config.json
  • Mac/Linux: ~/.free-claude-code/config.json

View logs

Logs are stored in ~/.free-claude-code/logs/


πŸ“¦ What's Included

  • βœ… Router Server - Routes Claude Code to any API
  • βœ… Web UI - Visual config at fcc ui
  • βœ… Model Switcher - Change models with fcc model
  • βœ… Preset System - Save and share configs
  • βœ… Multiple Providers - Use different APIs for different tasks

🀝 Contributing

Contributions welcome! See GitHub.

πŸ“„ License

MIT License - Use freely!


Made with ❀️ by keepuahead

⬆ Back to Top

About

Easiest way of Installing Claude-Code with Custom APIs provider.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors