Use DeepSeek V4 Pro in OpenCode: setup and pricing

Add BigModel.io as a provider in opencode.json to run DeepSeek V4 Pro (deepseek-v4-pro) in OpenCode. $0.66 input / $1.98 output per 1M tokens, with a config you can paste.

Model ID
deepseek-v4-pro
Input / 1M
$0.66
Output / 1M
$1.98
Context
1M

Set up OpenCode with DeepSeek V4 Pro

  1. Create an API key in the BigModel.io console and give it a spend limit; agents send long contexts.
  2. Put the block below in ~/.config/opencode/opencode.json and export BIGMODEL_API_KEY in your shell.
  3. Run opencode; /models lists deepseek-v4-pro under BigModel.io.

~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "bigmodel": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "BigModel.io",
      "options": {
        "baseURL": "https://bigmodel.io/v1",
        "apiKey": "{env:BIGMODEL_API_KEY}"
      },
      "models": {
        "deepseek-v4-pro": {
          "name": "DeepSeek V4 Pro",
          "limit": {
            "context": 1000000,
            "output": 64000
          }
        }
      }
    }
  },
  "model": "bigmodel/deepseek-v4-pro"
}

Check the key and model first

This request should return a short reply. If it fails, the tool will fail the same way.

curl https://bigmodel.io/v1/chat/completions \
  -H "Authorization: Bearer $BIGMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-pro","messages":[{"role":"user","content":"ping"}]}'

401 means the key is wrong, 404 the model ID; fix 401 · fix 404

What it costs

DeepSeek V4 Pro costs $0.66 per 1M input tokens and $1.98 per 1M output tokens, $0.044 per 1M cached input tokens. A typical agent turn with 20K tokens in and 2K out costs about $0.017; 100 turns about $1.72. DeepSeek V4 Pro pricing →

Other setups