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
/modelsagain 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.