
How to Use Claude Code with Ollama, Kimi and GLM
Running Claude Code against a non-Claude model works, and you do it on a path the providers document themselves rather than through a hack. Ollama, Moonshot and Z.ai all publish an Anthropic-compatible endpoint. Setup comes down to three environment variables. This guide covers the steps for all three providers, how to make the configuration stick, and the errors people hit most π The Short Answer Three providers, three addresses Provider ANTHROPIC_BASE_URL Ollama (local) http://localhost:11434 Moonshot / Kimi https://api.moonshot.ai/anthropic Z.ai / GLM https://api.z.ai/api/anthropic MiniMax https://api.minimax.io/anthropic Alibaba / Qwen depends on the plan Add ANTHROPIC_AUTH_TOKEN and a model name and thatβs the whole setup. ...