Skip to content
Lucky Snail Logo Lucky Snail
中文

Integrate DeepSeek-V3.1-Terminus into Claude Code and Codex in One Minute

/ 1 min read /
#ai
Table of Contents 目录

Just recently, DeepSeek released the ultimate version of V3. I’ve been getting rate-limited using Claude Code and Codex lately, so follow along as I quickly integrate the latest DeepSeek into cc and Codex!

Integrating with Claude Code

1️⃣ Global Installation

Terminal window
npm install -g @anthropic-ai/claude-code

2️⃣ Configure Environment Variables

First, go to the DeepSeek official API dashboard to generate an API key.

image.png

Then configure in the terminal:

Terminal window
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=你的DEEPSEEK_API_KEY
export ANTHROPIC_MODEL=deepseek-chat
export ANTHROPIC_SMALL_FAST_MODEL=deepseek-chat

3️⃣ Test Usage

Run claude to start, then we see:

image.png

This means success! 🎉

Codex

Codex is OpenAI’s terminal coding agent CLI, similar to Claude Code.

1️⃣ Installation

Terminal window
npm install -g @openai/codex

2️⃣ Configuration

# 定义一个 DeepSeek 提供方(OpenAI 兼容)
[model_providers.deepseek]
name = "DeepSeek"
base_url = "https://api.deepseek.com/v1"
wire_api = "chat"
env_key = "DEEPSEEK_API_KEY"
[profiles.deepseek-chat]
model_provider = "deepseek"
model = "deepseek-chat"

3️⃣ Test Usage

Terminal window
export DEEPSEEK_API_KEY="sk-xxx"
codex --profile deepseek-chat

Seeing the following means success!

image.png

References

  1. Claude Code official documentation: https://claude.com/product/claude-code
  2. Codex official documentation: https://developers.openai.com/codex/cli/