浏览方案库Browse solutions全部方案All solutions

配置教程Setup guide

Claude Code 平替:兼容 API 接入 DeepSeekClaude Code Alternative: Connecting to DeepSeek via a Compatible API

保留命令行 Agent 工作流,把模型切到国内兼容 API。Keep your CLI agent workflow while switching the model to a domestic compatible API.

Key configuration (click to copy)

Base URL
https://api.deepseek.com
Reasoning model
deepseek-reasoner
Coding model
deepseek-coder

Claude Code Alternative: Connecting to DeepSeek via a Compatible API

Who it's for

  • Developers already used to CLI agent workflows
  • Those who want to keep multi-turn task loops and file-level editing capabilities
  • Anyone who wants to switch the model to a domestic compatible API

Prerequisites

  • A working Claude Code-style CLI environment
  • A DeepSeek API Key
  • A writable local environment variable configuration

Key configuration

  • Base URL: https://api.deepseek.com
  • Reasoning model: deepseek-reasoner
  • Coding model: deepseek-coder

Setup steps

  1. Locate where the CLI agent reads model configuration or environment variables.
  2. Switch the provider to OpenAI-compatible mode.
  3. Enter the Base URL, API Key, and default model.
  4. Smoke-test with a single-file editing task first, then move on to multi-file edits and command execution chains.

Troubleshooting

  • If tool-calling is unstable, shorten the task chain and reduce the context sent at once.
  • If output drifts too much, split tasks into smaller pieces and specify target files explicitly.
  • If you hit compatibility errors, confirm the client does not hard-depend on a proprietary field.

Cost note

CLI agent costs fluctuate more than in-editor Q&A. For complex task scenarios, set a budget cap in advance.

配置完成?Setup complete?

前往官方平台开通服务,开始使用 AI 编程。Head to the official site to activate the service and start AI coding.