Skip to content

llmapi-pro/claude-code-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code Setup

One-line installer and setup guide for Claude Code CLI with the LLM API Claude-compatible relay.

License: MIT Made for Claude Code

What this is

Claude Code is Anthropic's official agentic CLI for AI-assisted coding. Claude Code CLI supports a configurable backend via the documented ANTHROPIC_BASE_URL environment variable — you can point it at any Anthropic-API-compatible endpoint.

This repo provides:

  • One-line install scripts (Windows PowerShell, macOS, Linux)
  • Manual setup instructions
  • A common-issues reference

The default backend used by these scripts is LLM API — a Claude-compatible API relay service running a multi-provider pool with automatic failover, directly accessible from China without VPN, and supporting CNY billing via Alipay/WeChat.

Quick install (60 seconds)

Windows (PowerShell)

irm llmapi.pro/setup.ps1 | iex

macOS / Linux

curl -fsSL llmapi.pro/setup.sh | bash

The installer will:

  1. Install Claude Code CLI via npm (if not already installed)
  2. Walk you through registering at llmapi.pro to get a free API key
  3. Set the two environment variables (ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY)
  4. Run a connectivity check

Manual setup

If you would rather not run a script:

# 1. Install Claude Code CLI
npm install -g @anthropic-ai/claude-code

# 2. Get a free API key from https://llmapi.pro/register

# 3. Set environment variables (add to ~/.bashrc or ~/.zshrc)
export ANTHROPIC_BASE_URL=https://llmapi.pro
export ANTHROPIC_API_KEY=sk-...your-key...

# 4. Use Claude Code
claude

To switch back to the default backend, just unset ANTHROPIC_BASE_URL.

Troubleshooting

Symptom Likely cause Fix
Connection refused / TLS hangs Network issue Try a different ISP or DNS
401 Unauthorized Wrong API key Re-copy the key from your dashboard
429 Rate limit exceeded Free tier cap hit See the 429 triage guide
Tools fail silently Claude Code version mismatch npm update -g @anthropic-ai/claude-code
Behind GFW / China network issues Direct foreign endpoints unreliable See the China setup guide

Why use a relay backend?

Direct foreign API LLM API relay
China access VPN required Direct from most ISPs
Payment Foreign card Alipay / WeChat / CNY
Failover Single vendor Multi-provider pool
Setup Account + billing One API key

More background on the relay model: llmapi.pro/blog.

Recommended extensions

Once you have Claude Code running, consider these workflow add-ons:

  • claude-next — One-key handoff between deep Claude Code sessions. When a long conversation starts hallucinating past ~400K tokens, /next in the old window produces an audited handoff; paste continue A in a new window to resume instantly. npx claude-next install.
  • claude-md-templates — Drop-in CLAUDE.md templates tuned for popular stacks (Next.js, FastAPI, Go, Rust, etc.).
  • awesome-claude-code — Curated list of other high-quality Claude Code tools and guides.

Related blogs

License

MIT — see LICENSE.

Disclaimer

LLM API and this repository are independent of Anthropic and not affiliated with Anthropic. Claude Code CLI is Anthropic's official tool that supports configurable backends via the documented ANTHROPIC_BASE_URL environment variable.

About

One-line installer and setup guide for Claude Code CLI with the LLM API Claude-compatible relay

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages