// I want to solve · Developers / Individuals
🔁 Switch models: your own key, Chinese or local models
Point coding agents and apps at other vendors, Chinese models or local models, and understand protocol compatibility and differences in tool-calling quality.
4 steps3 alternatives2 stacks · 2 problemschecked 2026-10-22
How to do it
- 01Check which protocol the tool supports: OpenAI-compatible, Anthropic-compatible, or vendor-only
- 02Most Chinese models offer OpenAI / Anthropic-compatible endpoints; change base_url and key per their docs
- 03Use LiteLLM or claude-code-router to translate when protocols differ
- 04After switching, test tool-calling success on the same task set
What it costs
Free start
Free APIs exist; see the Free API page
Pay as you go
Chinese model APIs are usually much cheaper than Western flagships; see pricing
Individual paid
China coding plans are monthly; see subscriptions
Prices change; the vendor’s official page wins. Subscriptions compared · API prices
Alternatives: which to pick
| Option | Choose it when |
|---|---|
| LiteLLM | Protocol translation and one endpoint |
| claude-code-router | Use other models in Claude Code |
| Ollama | Switch to local models |
✓ Good fit
- Cut cost, avoid single-vendor risk, use Chinese or local models
✗ Not a good fit
- You rely on vendor-only features
Ready-made stacks
All stacksSoftware that helps
All software🔀 Model gateways, routing & usage🖥️ Local inference & serving
Problems & solutions
All problems- How-toUse Claude Code with other models (Chinese models, your own gateway)Claude Code can send requests to any Anthropic-compatible endpoint set via environment variables. Many model vendors offer Anthropic-compatible APIs, and gateways such as LiteLLM or claude-code-router can translate formats.
- How-toUse Codex CLI with local or custom model providersCodex CLI’s config file supports custom model providers that point at any OpenAI-compatible endpoint, including a local Ollama.
Needs in this scenario
-
AGT-03Model lock-in: bring your own key, custom base_url, local models
Agent products & builders · People search for: use claude code with other models; cursor custom base url; codex ollama
-
OSS-06Chinese models with overseas tools: compatibility
Open-source ecosystem · People search for: qwen with claude code; deepseek tool calling cline
-
VEN-05Protocol compatibility matrix (MCP/A2A/Skills/AGENTS.md/two API formats)
Model vendors · People search for: a2a vs mcp; anthropic compatible api models
-
VEN-03Consistency of the same open model across inference providers
Model vendors · People search for: kimi k2 provider comparison; open model tool calling accuracy provider
-
IND-08Open-source / bring-your-own-key alternatives to closed tools
Individual developers & researchers · People search for: open source cursor alternative; free copilot alternative
Learn
All tutorials- Ollama 文档
Ollama · Inference & deployment · English
- vLLM 文档
vLLM · Inference & deployment · English
- SGLang 文档
SGLang · Inference & deployment · English
- llama.cpp
ggml-org · Inference & deployment · English
- LM Studio 文档
LM Studio · Inference & deployment · English
- Apple Machine Learning Research / Core ML 文档
Apple · Inference & deployment · English
- MLX 文档
Apple ML Research · Inference & deployment · English
- 阿里云百炼 文档
阿里云 · Using AI tools · Chinese
- handy-ollama 动手学 Ollama
Datawhale · Inference & deployment · Chinese
- llm-deploy 大模型推理部署
Datawhale · Inference & deployment · Chinese