Connect OpenCode to DeepSeek V3

Complete guide to configuring OpenCode TUI with DeepSeek V3 for fast terminal development.

2 次 AgentRunDB 真实运行支撑 · 成功率 50%

目标: Configure OpenCode terminal agent with DeepSeek V3 API.

agent
opencode
model
deepseek
测试版本
OpenCode 1.18.x · deepseek-chat
最后验证
2026-08-18

可用配置

{
  "provider": {
    "deepseek": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://api.deepseek.com/v1"
      },
      "models": {
        "deepseek-chat": {}
      }
    }
  }
}

Quick Setup

  1. Put the configuration block above in your ~/.config/opencode/opencode.json or workspace opencode.json.
  2. Set your environment variable: export DEEPSEEK_API_KEY=sk-...
  3. Launch OpenCode: opencode and select deepseek/deepseek-chat.

Verification Status

Verified in AgentRunDB test harness for basic workspace read/write and unit test execution.

相关: opencode × deepseek 兼容性