@sunflower0305/claude-proxy
v1.2.0
Published
A proxy that lets Claude Agent SDK use domestic Chinese LLMs (DeepSeek, Qwen, GLM, MiniMax) as backend
Downloads
807
Maintainers
Readme
claude-proxy
claude-proxy is published on npm as @sunflower0305/claude-proxy. It is a lightweight Express proxy that lets Claude Code or the Claude Agent SDK talk to domestic Chinese LLM providers through Anthropic-compatible /v1/messages endpoints.
It currently supports qwen, deepseek, glm, minimax, and kimi.
Install
Requires Node.js 20.12 or newer.
Run without installing:
npx @sunflower0305/claude-proxyOr install globally:
npm install -g @sunflower0305/claude-proxy
claude-proxyConfigure
The proxy reads configuration from environment variables. You can export them in your shell or create a .env file in the directory where you run claude-proxy; .env loading uses Node.js built-in .env file support.
Example .env:
PROVIDER=deepseek
PROXY_PORT=8080
DEEPSEEK_API_KEY=your-deepseek-api-key
DEEPSEEK_MODEL=deepseek-v4-proAvailable variables:
| Variable | Purpose |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| PROVIDER | Active provider. Defaults to deepseek. |
| PROXY_PORT | Local server port. Defaults to 8080. |
| QWEN_API_KEY | API key for Qwen. |
| DEEPSEEK_API_KEY | API key for DeepSeek. |
| GLM_API_KEY | API key for GLM. |
| MINIMAX_API_KEY | API key for MiniMax. |
| KIMI_API_KEY | API key for Kimi. |
| QWEN_ANTHROPIC_BASE_URL, DEEPSEEK_ANTHROPIC_BASE_URL, GLM_ANTHROPIC_BASE_URL, MINIMAX_ANTHROPIC_BASE_URL, KIMI_ANTHROPIC_BASE_URL | Override the upstream Anthropic-compatible base URL for a provider. |
| QWEN_MODEL, DEEPSEEK_MODEL, GLM_MODEL, MINIMAX_MODEL, KIMI_MODEL | Override the default upstream model for a provider. |
Provider defaults:
| Provider | Model env | Default model |
| --- | --- | --- |
| deepseek (default) | DEEPSEEK_MODEL | deepseek-v4-pro |
| qwen | QWEN_MODEL | qwen-plus |
| glm | GLM_MODEL | glm-5.1 |
| minimax | MINIMAX_MODEL | MiniMax-M2.7-highspeed |
| kimi | KIMI_MODEL | kimi-k2.6 |
You can use the bundled example as a starting point:
cp node_modules/@sunflower0305/claude-proxy/.env.example .envIf you installed globally, create .env manually or export the variables in your shell before starting the proxy.
Start The Proxy
claude-proxyWhen the server starts, it listens on http://localhost:8080 by default.
Point Claude Code or the Claude Agent SDK at the proxy:
export ANTHROPIC_BASE_URL=http://localhost:8080
export ANTHROPIC_API_KEY=any-string-worksExample SDK usage:
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "http://localhost:8080",
apiKey: "any-string",
});Runtime Endpoints
| Method | Path | Description |
| -------------- | --------------- | ------------------------------------------ |
| POST | /v1/messages | Main Anthropic Messages API proxy endpoint |
| GET | /v1/models | Lists supported Claude-facing model ids |
| GET | /health | Health check |
| GET / POST | /api/provider | Read or switch the active provider |
Health check:
curl http://localhost:8080/healthSwitch provider at runtime:
curl -X POST http://localhost:8080/api/provider \
-H "Content-Type: application/json" \
-d '{"provider":"qwen"}'Library Usage
The package also keeps the programmatic Express entrypoint:
import { createApp } from "@sunflower0305/claude-proxy";
const app = createApp();
app.listen(8080);Development
From source:
npm install
npm run devChangelog
See CHANGELOG.md and GitHub Releases for release notes.
License
MIT
