The integration of AI coding tools with powerful large language models (LLMs) has streamlined software development workflows. OpenClaude, an open-source command-line interface (CLI) for AI-assisted coding, combined with DeepSeek V4-Pro—a high-performance, cost-effective LLM—offers a robust solution for developers. This guide provides a detailed, step-by-step walkthrough to set up OpenClaude with DeepSeek V4-Pro on macOS, covering installation, configuration, IDE integration, and practical usage, with key pricing and troubleshooting insights.

Prerequisites

Before starting, ensure the following requirements are met:

  • A macOS device (recent versions compatible)
  • Stable internet access to reach DeepSeek’s platform
  • Basic terminal proficiency (Command + Space to launch Terminal)

Step 1: Install Node.js

OpenClaude requires Node.js 20 or newer. Verify installation first:

node --version

If outdated or missing, install via:

  • Official Installer: Download the LTS version from nodejs.org, then follow the prompts.
  • Homebrew:
brew install node

Confirm successful installation with node --version and npm --version.

Step 2: Install Ripgrep

Ripgrep is required for OpenClaude’s code-search functionality. For domestic networks, use mirrors for faster installation:

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
HOMEBREW_NO_AUTO_UPDATE=1 brew install ripgrep

Verify with rg --version. Install Homebrew first if missing:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 3: Install OpenClaude

Install OpenClaude globally via npm:

npm install -g @gitlawb/openclaude

Validate installation:

openclaude --version

Restart the terminal if a "command not found" error occurs.

Step 4: Obtain DeepSeek API Key

Access DeepSeek’s platform to generate an API key:

  1. Visit platform.deepseek.com
  2. Register/login with email or phone
  3. Navigate to "API Keys" in the left menu
  4. Click "Create API Key" and save the generated sk-xxx key (shown once only)

Step 5: Configure OpenClaude

Three configuration methods are available; permanent setup is recommended.

Method 1: Temporary Environment Variables (Per Session)

export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_BASE_URL=https://api.deepseek.com/v1
export OPENAI_API_KEY=sk-xxx (replace with your key)
export OPENAI_MODEL=deepseek-v4-pro
openclaude

Method 2: Permanent Shell Configuration

Determine your shell with echo $SHELL (zsh for macOS Catalina+, bash for older versions).

  • Zsh (~/.zshrc):
echo 'export CLAUDE_CODE_USE_OPENAI=1' >> ~/.zshrc
echo 'export OPENAI_BASE_URL=https://api.deepseek.com/v1' >> ~/.zshrc
echo 'export OPENAI_API_KEY=sk-xxx' >> ~/.zshrc
echo 'export OPENAI_MODEL=deepseek-v4-pro' >> ~/.zshrc
source ~/.zshrc
  • Bash (~/.bash_profile):
echo 'export CLAUDE_CODE_USE_OPENAI=1' >> ~/.bash_profile
echo 'export OPENAI_BASE_URL=https://api.deepseek.com/v1' >> ~/.bash_profile
echo 'export OPENAI_API_KEY=sk-xxx' >> ~/.bash_profile
echo 'export OPENAI_MODEL=deepseek-v4-pro' >> ~/.bash_profile
source ~/.bash_profile

Edit directly with code ~/.zshrc (VS Code) or nano ~/.zshrc if preferred.

Method 3: Interactive /provider Command

Launch OpenClaude and configure interactively:

openclaude
/provider

Select "OpenAI-compatible", enter the base URL, API key, and model name, then save.

Step 6: VS Code Integration

OpenClaude offers IDE integration for streamlined workflows.

Official Extension

  1. Clone the repository:
git clone https://github.com/Gitlawb/openclaude
cd openclaude/vscode-extension/openclaude-vscode
  1. Install dependencies and build:
npm install
npm run build
npx vsce package
  1. Install the .vsix file via VS Code’s "Install from VSIX" command.

Third-Party Plugin

Install "Claude Code Integration" from the VS Code Marketplace for simplified setup. Configure the DeepSeek base URL, API key, and model name in extension settings.

VS Code Usage

  • Launch the OpenClaude panel via the command palette
  • Input prompts directly, select code snippets for AI assistance, or request bug fixes
  • Use the built-in terminal (`Control + ``) for quick CLI access

Core Use Cases

OpenClaude + DeepSeek V4-Pro supports diverse development tasks:

  • Code Generation: Build Vue components, API endpoints, or utility functions
  • Debugging: Fix authentication errors, resolve dependency conflicts, or patch broken logic
  • Code Review: Audit code quality, identify security risks, and suggest optimizations
  • Documentation: Generate API docs or explain complex module logic
  • Refactoring: Convert legacy syntax (e.g., var to const/let)

Pricing Overview

DeepSeek V4-Pro offers permanent discounted rates (effective May 2026):

  • Input (Cache Hit): $0.435 per million tokens
  • Input (Cache Miss): $3 per million tokens
  • Output: $0.87 per million tokens

Daily costs for typical development range from cents to a few dollars, making it highly cost-effective.

Troubleshooting

  • Permission Denied: Reinstall with sudo npm install -g @gitlawb/openclaude
  • 401 Unauthorized: Regenerate a valid DeepSeek API key
  • Model Not Found: Verify the model name (deepseek-v4-pro)
  • Slow Responses: Switch to deepseek-v4-flash for faster performance
  • Multi-Model Support: Save multiple profiles via /provider to switch models seamlessly

Update & Uninstall

  • Update: npm install -g @gitlawb/openclaude@latest
  • Uninstall: npm uninstall -g @gitlawb/openclaude and remove shell config entries

Conclusion

Configuring OpenClaude with DeepSeek V4-Pro unlocks a powerful, affordable AI coding workflow on macOS. With straightforward installation, flexible configuration, and robust IDE integration, developers can leverage DeepSeek’s high performance for daily tasks without prohibitive costs.