Claude Code is no longer locked to Anthropic’s proprietary backend. A new configuration trick allows the agent to run on DeepSeek, GLM, Qwen, and Kimi models without a proxy or converter. By leveraging the Anthropic Messages format, any endpoint that accepts this standard can stand in for the official API, effectively decoupling the agent’s logic from its underlying intelligence.
The Two-Variable Setup
The process is deceptively simple. After installing Claude Code via npm, developers only need to set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. Crucially, the base URL should omit the /v1 path, as Claude Code appends /v1/messages automatically. Additional variables like ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL must be set to the specific target model ID, such as deepseek-v3.2, to ensure both primary and background tasks route correctly.
Performance Across Model Families
Testing on Claude Code version 2.1.284 and 2.1.296 revealed distinct performance tiers. While claude-sonnet-4-6 completed tasks in roughly 7 seconds, deepseek-v3.2 took about 9 seconds. Qwen3.8-max lagged at 24 seconds, and GLM-5.3 took 45 seconds. Kimi-k3 failed on the first attempt but succeeded on retry. These results highlight that while the agent loop remains functional across providers, latency varies significantly by model architecture and provider infrastructure.
Handling Unrecognized Models
Since version 2.1.290, Claude Code prints [claude-code:unrecognized_model] when using non-Anthropic model IDs. This is expected behavior as the tool auto-compacts sessions within an assumed context window. Developers can revert to previous behavior by setting CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1. Additionally, using ANTHROPIC_AUTH_TOKEN instead of ANTHROPIC_API_KEY avoids interactive confirmation prompts, streamlining the developer experience.
Key Takeaways
- Claude Code’s reliance on the Anthropic Messages format enables seamless backend swaps without complex middleware.
- Latency differences are significant: DeepSeek and Sonnet are fast, while GLM and Qwen exhibit higher delays.
- Proper configuration of ANTHROPIC_DEFAULT_HAIKU_MODEL is critical to prevent silent failures in background tasks.
- The unrecognized_model warning is a feature, not a bug, indicating context window management for third-party models.
The Bottom Line
This flexibility transforms Claude Code from a niche Anthropic tool into a universal agent runner, though the latency gaps mean developers must carefully weigh speed against cost and availability when choosing their backend.