Airsc miễn phí cho tất cả. Nếu nó giúp bạn, hãy ủng hộ $2–$20.

Ủng hộ
PluginAn toànQuy trình & bộ nhớ agentCần cài đặt chút

free-claude-code

codeaashu · codeaashu/free-claude-code

Công cụ này hoạt động như một proxy nhẹ, định tuyến các lệnh gọi API Anthropic của Claude Code đến các nhà cung cấp LLM miễn phí hoặc rẻ hơn như NVIDIA NIM hoặc OpenRouter.

Sử dụng Claude Code CLI & VSCode miễn phí. Không yêu cầu khóa Anthropic API. Một proxy nhẹ định tuyến các cuộc gọi API Anthropic của Claude Code đến NVIDIA NIM (40 yêu cầu/phút miễn phí), OpenRouter (hàng trăm mô hình), DeepSeek (API trực tiếp), LM Studio (hoàn toàn cục bộ) hoặc llama.cpp (cục bộ với các endpoint Anthropic).

292 sao78Giấy phép: MITCập nhật 2 tháng trước0 lượt mở

Xem trước

▍

Bạn có thể làm gì với nó

  • Sử dụng Claude Code mà không cần khóa API Anthropic.
  • Định tuyến các mô hình Claude Opus đến các nhà cung cấp khác, giá cả phải chăng hơn.
  • Kiểm tra mã tác nhân cục bộ bằng LM Studio hoặc llama.cpp với các điểm cuối Anthropic.

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README

🤖 Free Claude Code

Use Claude Code CLI & VSCode for free. No Anthropic API key required.

A lightweight proxy that routes Claude Code's Anthropic API calls to NVIDIA NIM (40 req/min free), OpenRouter (hundreds of models), DeepSeek (direct API), LM Studio (fully local), or llama.cpp (local with Anthropic endpoints).

Quick Start · Providers · Discord Bot · Configuration · Development · Contributing


Claude Code running via NVIDIA NIM, completely free

Features

FeatureDescription
Zero Cost40 req/min free on NVIDIA NIM. Free models on OpenRouter. Fully local with LM Studio
Drop-in ReplacementSet 2 env vars. No modifications to Claude Code CLI or VSCode extension needed
5 ProvidersNVIDIA NIM, OpenRouter, DeepSeek, LM Studio (local), llama.cpp (llama-server)
Per-Model MappingRoute Opus / Sonnet / Haiku to different models and providers. Mix providers freely
Thinking Token SupportParses `` tags and reasoning_content into native Claude thinking blocks
Heuristic Tool ParserModels outputting tool calls as text are auto-parsed into structured tool use
Request Optimization5 categories of trivial API calls intercepted locally, saving quota and latency
Smart Rate LimitingProactive rolling-window throttle + reactive 429 exponential backoff + optional concurrency cap
Discord / Telegram BotRemote autonomous coding with tree-based threading, session persistence, and live progress
Subagent ControlTask tool interception forces run_in_background=False. No runaway subagents
ExtensibleClean BaseProvider and MessagingPlatform ABCs. Add new providers or platforms easily

Quick Start

Prerequisites

  1. Get an API key (or use LM Studio / llama.cpp locally):
  2. Install Claude Code

Install uv

# Install uv (required to run the project)
pip install uv

If uv is already installed, run uv self update to get the latest version.

Clone & Configure

git clone https://github.com/codeaashu/free-claude-code.git
cd free-claude-code
cp .env.example .env

Choose your provider and edit .env:

NVIDIA NIM (40 req/min free, recommended)

NVIDIA_NIM_API_KEY="nvapi-your-key-here"

MODEL_OPUS=
MODEL_SONNET=
MODEL_HAIKU=
MODEL="nvidia_nim/z-ai/glm4.7"                     # fallback

# Global switch for provider reasoning requests and Claude thinking blocks.
ENABLE_THINKING=true

OpenRouter (hundreds of models)

OPENROUTER_API_KEY="sk-or-your-key-here"

MODEL_OPUS="open_router/deepseek/deepseek-r1-0528:free"
MODEL_SONNET="open_router/openai/gpt-oss-120b:free"
MODEL_HAIKU="open_router/stepfun/step-3.5-flash:free"
MODEL="open_router/stepfun/step-3.5-flash:free"     # fallback

DeepSeek (direct API)

DEEPSEEK_API_KEY="your-deepseek-key-here"

MODEL_OPUS="deepseek/deepseek-reasoner"
MODEL_SONNET="deepseek/deepseek-chat"
MODEL_HAIKU="deepseek/deepseek-chat"
MODEL="deepseek/deepseek-chat"                      # fallback

LM Studio (fully local, no API key)

MODEL_OPUS="lmstudio/unsloth/MiniMax-M2.5-GGUF"
MODEL_SONNET="lmstudio/unsloth/Qwen3.5-35B-A3B-GGUF"
MODEL_HAIKU="lmstudio/unsloth/GLM-4.7-Flash-GGUF"
MODEL="lmstudio/unsloth/GLM-4.7-Flash-GGUF"         # fallback

llama.cpp (fully local, no API key)

LLAMACPP_BASE_URL="http://localhost:8080/v1"

MODEL_OPUS="llamacpp/local-model"
MODEL_SONNET="llamacpp/local-model"
MODEL_HAIKU="llamacpp/local-model"
MODEL="llamacpp/local-model"

Mix providers

Each MODEL_* variable can use a different provider. MODEL is the fallback for unrecognized Claude models.

NVIDIA_NIM_API_KEY="nvapi-your-key-here"
OPENROUTER_API_KEY="sk-or-your-key-here"

MODEL_OPUS="nvidia_nim/moonshotai/kimi-k2.5"
MODEL_SONNET="open_router/deepseek/deepseek-r1-0528:free"
MODEL_HAIKU="lmstudio/unsloth/GLM-4.7-Flash-GGUF"
MODEL="nvidia_nim/z-ai/glm4.7"                      # fallback

Migration: NIM_ENABLE_THINKING was removed in this release. Rename it to ENABLE_THINKING.

Optional Authentication (restrict access to your proxy)

Set ANTHROPIC_AUTH_TOKEN in .env to require clients to authenticate:

ANTHROPIC_AUTH_TOKEN="your-secret-token-here"

How it works:

  • If ANTHROPIC_AUTH_TOKEN is empty (default), no authentication is required (backward compatible)
  • If set, clients must provide the same token via the ANTHROPIC_AUTH_TOKEN header
  • The claude-pick script automatically reads the token from .env if configured

Example usage:

# With authentication
ANTHROPIC_AUTH_TOKEN="your-secret-token-here" \
ANTHROPIC_BASE_URL="http://localhost:8082" claude

# claude-pick automatically uses the configured token
claude-pick

Use this feature if:

  • Running the proxy on a public network
  • Sharing the server with others but restricting access
  • Wanting an additional l
Xem mã nguồn trên GitHub