Skip to content

Connect OpenCode to DeepSeek V4

Connect OpenCode to DeepSeek V4 using the current built-in provider flow, select V4 Flash or Pro, verify the API connection, and fix common errors.

MGMCSA Guru Team August 26, 2026 3 min read
OpenCode model selector showing DeepSeek V4 Flash and V4 Pro

OpenCode now includes DeepSeek in its provider menu. You do not need to build a custom provider block for the usual setup. Add the credential with /connect, then choose the model with /models.

Before connecting

You need a DeepSeek API key with available credit and a current OpenCode installation. Run OpenCode from the repository you want it to inspect:

cd /path/to/project
opencode

If you use Windows, run the tool in the same environment where your project and OpenCode are installed. A WSL installation has separate files and credentials from a native Windows installation.

Add the DeepSeek credential

Inside OpenCode, run:

/connect

Select DeepSeek, then paste the API key when prompted. OpenCode stores the credential for that provider.

Select a current model

Run:

/models

Choose a DeepSeek V4 model:

DeepSeek V4 choices

deepseek-v4-flash Routine coding and faster responses
deepseek-v4-pro Harder reasoning and complex debugging

The retired deepseek-chat and deepseek-reasoner aliases should not remain in new OpenCode configurations.

Test before editing

Ask OpenCode to list the repository files and summarize one short file. Confirm that the response comes from the selected DeepSeek model before approving changes.

If the request succeeds, try a small edit and inspect the diff. This separates provider problems from permissions, repository, or tool-call problems.

When a custom provider is still useful

Use a custom provider only when DeepSeek traffic must pass through a gateway, proxy, or organization-specific endpoint. OpenCode’s custom provider schema uses @ai-sdk/openai-compatible for Chat Completions endpoints. The models map contains the exact model IDs exposed by that endpoint.

Do not add a custom provider merely to store the standard DeepSeek key. The built-in connection is shorter and receives model catalog updates from OpenCode.

Common problems

  • DeepSeek is missing from /connect: update OpenCode and restart it.
  • Authentication fails: create a new API key and paste it without surrounding spaces.
  • The model is not found: use /models again and remove retired aliases from local configuration files.
  • OpenCode connects to a different account: inspect the configured credentials and reconnect DeepSeek.
  • Tools fail even though chat works: test a small file operation and review OpenCode’s diagnostics. Model access does not guarantee that every tool request completed.
  • Windows and WSL show different providers: they are separate installations with separate credential stores.

OpenCode and DeepSeek checklist

  • DeepSeek API key created
  • DeepSeek added with /connect
  • Current V4 model selected with /models
  • Read-only request tested
  • First edit reviewed as a diff
  • Old DeepSeek aliases removed from custom configuration

Recheck the model list when DeepSeek or OpenCode releases a major update. The provider connection can stay valid while model IDs change.

Frequently asked questions

Does OpenCode support DeepSeek directly?

Yes. Current OpenCode releases list DeepSeek in the built-in provider connection menu. Use /connect to add the key and /models to select a current model.

Which DeepSeek model should I select?

Use DeepSeek V4 Flash for routine work and V4 Pro when a task needs more reasoning. The API IDs are deepseek-v4-flash and deepseek-v4-pro.

Do I need to edit opencode.json?

Not for the normal DeepSeek setup. The built-in provider flow handles the credential and model catalog. Edit the configuration only when you need a custom endpoint, proxy, or model override.

Why does an old DeepSeek configuration fail?

DeepSeek discontinued deepseek-chat and deepseek-reasoner on July 24, 2026. Replace those aliases with a current V4 model ID.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.