Anthropic-compatible API proxy for Qoder via qodercli.
Expose Qoder's AI capabilities through an Anthropic-compatible API, enabling Claude Code and other Anthropic clients to use Qoder's models (Qwen/GLM/Kimi) seamlessly.
- Anthropic API compatible — Drop-in replacement for
api.anthropic.com - Streaming & non-streaming — Full SSE streaming support
- Model mapping — Claude model names automatically mapped to Qoder tiers
- Tool support — Structured tool calling with automatic execution via qodercli
- Docker ready — One-command deployment with Docker Compose
- Python >= 3.11
- qodercli installed and authenticated
- Qoder Personal Access Token
# 1. Clone and install
git clone https://github.com/sontianye/qoder-api.git
cd qoder-api
uv sync --extra dev
# 2. Configure
cp .env.example .env
# Edit .env and set QODER_PERSONAL_ACCESS_TOKEN
# 3. Run
uv run python -m qoder_api.mainThe server will start at http://localhost:8000.
cp .env.example .env
# Edit .env with your token
docker compose up --buildexport ANTHROPIC_BASE_URL=http://localhost:8000
export ANTHROPIC_API_KEY=any
claude| Endpoint | Description |
|---|---|
GET /health |
Health check |
POST /v1/messages |
Chat completions (streaming + non-streaming) |
POST /v1/messages/count_tokens |
Token estimation stub |
| Variable | Default | Description |
|---|---|---|
QODER_PERSONAL_ACCESS_TOKEN |
— | Required qodercli auth token |
QODERCLI_PATH |
qodercli |
qodercli binary path |
QODER_TIMEOUT |
120 |
Request timeout (seconds) |
DEFAULT_MODEL_TIER |
auto |
Default model tier |
MAX_CONVERSATION_TURNS |
20 |
Conversation history limit |
DISALLOWED_TOOLS |
Bash,Edit,Write,... |
Blocked qodercli tools (security) |
MAX_TURNS |
1 |
Max agent iterations (security) |
MAX_CONCURRENT_REQUESTS |
10 |
Concurrent request limit |
ENABLE_IMAGES |
false |
Experimental image support |
ENABLE_NATIVE_TOOLS |
true |
Use native function calling |
API_KEY |
— | Optional proxy API key |
HOST |
0.0.0.0 |
Bind address |
PORT |
8000 |
Listen port |
LOG_LEVEL |
INFO |
Logging level |
See .env.example for all options.
# Run tests
uv run pytest
# Run with hot reload (for development)
uv run uvicorn qoder_api.main:app --reloadClaude Code → qoder-api → qodercli → Qoder Backend
↓
Anthropic-compatible
request/response format