Claude Code Third-party Vendor Usage Guide - In-depth Analysis & Best Practices

This article provides a detailed guide on configuring Claude Code with third-party vendors (such as DeepSeek, Z-AI, Moonshot, etc.), including environment variable setup, model selection optimization, Plan mode usage tips, and practical advice for avoiding common configuration pitfalls.

Claude Code Third-party Vendor Usage Guide

Introduction

Based on my long-term experience using Claude Code, this article shares how to efficiently configure third-party vendors and avoid common configuration pitfalls. Unlike self-media accounts that merely repost official information, the content here consists of practical tips that have been verified through actual use.

Environment Variable Configuration

Basic Configuration (Mentioned in most tutorials)

ANTHROPIC_BASE_URL=Your vendor API address
ANTHROPIC_AUTH_TOKEN=Your authentication token
ANTHROPIC_MODEL=Default model name

ANTHROPIC_SMALL_FAST_MODEL has been deprecated, replaced by ANTHROPIC_DEFAULT_HAIKU_MODEL.

Advanced Configuration (Rarely mentioned)

Claude Code currently supports selecting different models for different tasks:

# Configure different model series separately
ANTHROPIC_DEFAULT_OPUS_MODEL=opus series model
ANTHROPIC_DEFAULT_SONNET_MODEL=sonnet series model
ANTHROPIC_DEFAULT_HAIKU_MODEL=haiku series model

# Models used by subagents
CLAUDE_CODE_SUBAGENT_MODEL=subagent model
# Set timeout duration
BASH_DEFAULT_TIMEOUT_MS=10000
# Disable non-essential traffic
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
# Disable cost warnings, otherwise alerts will appear every $5 according to Claude sonnet pricing
DISABLE_COST_WARNINGS=1
# Disable non-essential model calls
DISABLE_NON_ESSENTIAL_MODEL_CALLS=1
# Disable telemetry
DISABLE_TELEMETRY=1

claudecod-with-third-party-vendor-2025-09-17-22-22-43

More configuration references: https://docs.claude.com/en/docs/claude-code/settings#environment-variables

Plan Mode Usage Tips

Claude Code’s Plan Mode is a very useful feature that allows the AI to think more without directly modifying files. This mode works particularly well with DeepSeek’s Reasoner model. In plan mode, you can:

  • Reduce unnecessary file modifications
  • Provide more detailed thought processes
  • Suitable for complex code reviews and design decisions

Quick Switching Between Third-party Vendors

Some people have created Claude Code Router tools to integrate third-party model vendors into Claude Code, while others have made environment variable switchers. I strongly advise against using these additional operations. What you really need is simply to open VS Code settings, then search for terminal.integrated.env, and configure the first three configurable items.

vscode settings

Like this:

claudecod-with-third-party-vendor-2025-09-17-22-23-05

Then every time you open a new terminal within VS Code, it will use the new environment variables. No need to use additional third-party tools, just configure your VS Code.

Many users try to use Claude Code Router or write conversion scripts for convenient use of Claude Code, but these methods often stem from unfamiliarity with VS Code and API interfaces.

Recommendation: Choose vendors that natively support the Anthropic API officially, rather than spending time on API conversion yourself. Reasons include:

  • Anthropic API conversion is complex and difficult to adapt perfectly
  • Officially supported vendors provide more stable services
  • Avoid compatibility issues and unnecessary debugging time

There’s a huge gap between converting regular APIs to Anthropic API. Here’s the compatibility table for DeepSeek’s official Anthropic API conversion: DeepSeek-anthropic_api#anthropic-api-compatibility-details

Even official conversions have so many incompatibilities, let alone doing it yourself. I recommend not wasting time on these things.

Third-party Vendors in China Supporting Claude Code

Currently, the vendors I know in China that natively support Anthropic API include:

  • DeepSeek - Excellent overall performance
  • Z-AI - Provides good API support
  • Moonshot - Large parameter count
  • ModelScope - Only GLM-4.5 works smoothly

None of them perfectly support Claude Code, with various issues such as DeepSeek not supporting subagent, and none of the four supporting images and documents, etc. If you want to experience the full power of Claude Code, the minimum entry threshold is the $100 Max plan, not the $20 Pro plan, because Pro cannot use Opus models.

DeepSeek

"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
"ANTHROPIC_AUTH_TOKEN": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-reasoner",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-chat",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-chat",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-reasoner",

Z-AI

"ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
"ANTHROPIC_AUTH_TOKEN": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-4.5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air",
"CLAUDE_CODE_SUBAGENT_MODEL": "glm-4.5",

Moonshot

"ANTHROPIC_BASE_URL": "https://api.moonshot.cn/anthropic",
"ANTHROPIC_AUTH_TOKEN": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ANTHROPIC_MODEL": "kimi-k2-turbo-preview",

ModelScope

"ANTHROPIC_BASE_URL": "https://api-inference.modelscope.cn",
"ANTHROPIC_AUTH_TOKEN": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-ai/DeepSeek-R1-0528",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "ZhipuAI/GLM-4.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "Qwen/Qwen3-Coder-480B-A35B-Instruct",
"CLAUDE_CODE_SUBAGENT_MODEL": "ZhipuAI/GLM-4.5",

Conclusion

Every time I publish AI-related documentation, some people post spam advertisements in the comments section. Here I solemnly remind everyone: Absolutely do not use any API relay services, there are significant security risks.

For specific security concerns, please refer to: Model Router Security Risk Analysis