Use SiliconFlow in Claude Code

Prices and modelsEndpoint verified 2026-11-09

Generate a Claude Code config from the Anthropic-compatible endpoint in SiliconFlow's docs. The API key in the config is a placeholder; replace it with a key you create at SiliconFlow.

Endpoints

  • Pay as you gohttps://api.siliconflow.cnDocs · verified 2026-11-09

Generate the config

Pick from the 9 models this provider sells, or type another model name.

Save to ~/.claude/settings.json; merge it in if the file already exists
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.siliconflow.cn",
    "ANTHROPIC_API_KEY": "YOUR_API_KEY",
    "ANTHROPIC_MODEL": "deepseek-ai/DeepSeek-V4.1-Flash",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-ai/DeepSeek-V4.1-Flash",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-ai/DeepSeek-V4.1-Flash",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "deepseek-ai/DeepSeek-V4.1-Flash",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-ai/DeepSeek-V4.1-Flash"
  }
}

Models and prices

ModelInputOutputRatio
DeepSeek V4.1 Flashdeepseek-ai/DeepSeek-V4.1-Flash$0.30$1.202.00×
GLM-5.3-Flashzai-org/GLM-5.3-Flash$0.12$0.421.00×
GLM-5.3zai-org/GLM-5.3$1.20$4.201.00×
DeepSeek V4 Prodeepseek-ai/DeepSeek-V4-Pro$1.80$3.601.82×
DeepSeek V4 Flashdeepseek-ai/DeepSeek-V4-Flash$0.45$1.35—
GLM-5.2zai-org/GLM-5.2$1.20$4.201.00×
Kimi K2.7 Codemoonshotai/Kimi-K2.7-Code$0.974$4.051.00×
Kimi K2.6Pro/moonshotai/Kimi-K2.6$0.974$4.051.00×
GLM-5.1Pro/zai-org/GLM-5.1$0.899$3.601.00×
$ per 1M tokens. Each model uses the provider's cheapest group; the ratio uses the output price

How to check it works

Restart Claude Code and send a message. If it replies and the request shows up in SiliconFlow's console, it is using this endpoint.

FAQ

settings.json or environment variables?

settings.json applies every time Claude Code starts, for long-term use; the environment variables apply to the current terminal only, for a quick try.

How do I switch back to Anthropic?

Remove these variables from settings.json (or close the terminal where you set them), then restart Claude Code.

Does my key pass through this site?

No. The page only generates config text and never asks for your key; the key only goes into the config file or terminal on your own machine.

Claude Code configs for other providers