Claude Code is Anthropic’s CLI coding agent. With Lightweight, you can run Claude Code against any model in the catalog — including OpenAI, Google, and xAI models — through the native Anthropic interface.
Lightweight’s Anthropic-compatible endpoint means Claude Code works natively — no workaround flags, no shims, no extra configuration needed.
Setup
Set two environment variables to point Claude Code at Lightweight:
Bash / macOS / Linux
PowerShell / Windows
export ANTHROPIC_BASE_URL="https://api.lightweight.one/v1"
export ANTHROPIC_API_KEY="lw_sk_your-key-here"
Add these to your ~/.bashrc, ~/.zshrc, or ~/.profile to persist across sessions:echo 'export ANTHROPIC_BASE_URL="https://api.lightweight.one/v1"' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY="lw_sk_your-key-here"' >> ~/.zshrc
source ~/.zshrc
$env:ANTHROPIC_BASE_URL = "https://api.lightweight.one/v1"
$env:ANTHROPIC_API_KEY = "lw_sk_your-key-here"
To persist across sessions, set them as system environment variables:[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.lightweight.one/v1", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "lw_sk_your-key-here", "User")
Then launch Claude Code as usual:
That’s it — Claude Code will now route all requests through Lightweight.
Model Selection Overrides
By default, Claude Code uses its standard model selection. You can override which model is used for each role with environment variables:
Bash / macOS / Linux
PowerShell / Windows
# Use Opus 4.6 as the primary model
export CLAUDE_CODE_USE_BEDROCK=0
export CLAUDE_MODEL="claude-opus-4.6"
# Override the "big" model (Opus-class tasks)
export CLAUDE_OPUS_MODEL="claude-opus-4.6"
# Override the "mid" model (Sonnet-class tasks)
export CLAUDE_SONNET_MODEL="claude-sonnet-4.6"
# Override the "small" model (Haiku-class tasks)
export CLAUDE_HAIKU_MODEL="claude-haiku-4.5"
$env:CLAUDE_CODE_USE_BEDROCK = "0"
$env:CLAUDE_MODEL = "claude-opus-4.6"
# Override the "big" model (Opus-class tasks)
$env:CLAUDE_OPUS_MODEL = "claude-opus-4.6"
# Override the "mid" model (Sonnet-class tasks)
$env:CLAUDE_SONNET_MODEL = "claude-sonnet-4.6"
# Override the "small" model (Haiku-class tasks)
$env:CLAUDE_HAIKU_MODEL = "claude-haiku-4.5"
Fast Mode with claude-opus-4.6-fast
Lightweight offers claude-opus-4.6-fast — an optimized routing configuration that delivers lower latency for Opus-class tasks. This is ideal for interactive Claude Code sessions where responsiveness matters.
Bash / macOS / Linux
PowerShell / Windows
export ANTHROPIC_BASE_URL="https://api.lightweight.one/v1"
export ANTHROPIC_API_KEY="lw_sk_your-key-here"
export CLAUDE_MODEL="claude-opus-4.6-fast"
export CLAUDE_OPUS_MODEL="claude-opus-4.6-fast"
$env:ANTHROPIC_BASE_URL = "https://api.lightweight.one/v1"
$env:ANTHROPIC_API_KEY = "lw_sk_your-key-here"
$env:CLAUDE_MODEL = "claude-opus-4.6-fast"
$env:CLAUDE_OPUS_MODEL = "claude-opus-4.6-fast"
claude-opus-4.6-fast uses the same model with optimized routing for faster first-token times. Same quality, lower latency.
settings.json Alternative
If you prefer not to use environment variables, you can configure Claude Code via its settings.json file:
Edit ~/.claude/settings.json:{
"apiBaseUrl": "https://api.lightweight.one/v1",
"apiKey": "lw_sk_your-key-here",
"model": "claude-opus-4.6"
}
Edit %APPDATA%\claude\settings.json:{
"apiBaseUrl": "https://api.lightweight.one/v1",
"apiKey": "lw_sk_your-key-here",
"model": "claude-opus-4.6"
}
Extended Thinking
Claude models accessed through Lightweight support extended thinking (chain-of-thought reasoning). When enabled, the model will reason through complex problems step by step before producing a response.
Extended thinking is automatically available when using Claude Code with Lightweight — no additional configuration is needed. Claude Code will use extended thinking when appropriate based on the complexity of your prompt.
Supported models:
claude-opus-4.6
claude-opus-4.6-fast
claude-sonnet-4.6
claude-sonnet-4.5
Full Example
Here’s a complete setup for the best Claude Code experience with Lightweight:
Bash / macOS / Linux
PowerShell / Windows
# Core configuration
export ANTHROPIC_BASE_URL="https://api.lightweight.one/v1"
export ANTHROPIC_API_KEY="lw_sk_your-key-here"
# Use fast Opus for primary tasks, Sonnet for lighter tasks
export CLAUDE_MODEL="claude-opus-4.6-fast"
export CLAUDE_OPUS_MODEL="claude-opus-4.6-fast"
export CLAUDE_SONNET_MODEL="claude-sonnet-4.6"
export CLAUDE_HAIKU_MODEL="claude-haiku-4.5"
# Launch Claude Code
claude
# Core configuration
$env:ANTHROPIC_BASE_URL = "https://api.lightweight.one/v1"
$env:ANTHROPIC_API_KEY = "lw_sk_your-key-here"
# Use fast Opus for primary tasks, Sonnet for lighter tasks
$env:CLAUDE_MODEL = "claude-opus-4.6-fast"
$env:CLAUDE_OPUS_MODEL = "claude-opus-4.6-fast"
$env:CLAUDE_SONNET_MODEL = "claude-sonnet-4.6"
$env:CLAUDE_HAIKU_MODEL = "claude-haiku-4.5"
# Launch Claude Code
claude
No workaround flags needed. Unlike some third-party proxies, Lightweight’s Anthropic-compatible endpoint works natively with Claude Code. Do not pass --disable-prompt-caching or similar flags — they are unnecessary and may degrade performance.