How to connect DeepSeek to OpenCode and check which model is answering
Connect your DeepSeek API key to OpenCode, choose Flash or Pro, or try the free hosted model. Follow a ten-timecode test and calculate the cost of a sample workload.

To connect DeepSeek to OpenCode, start OpenCode, enter /connect, select DeepSeek, and enter the API key from your DeepSeek Platform account. Then use /models to choose a model under that provider. If you would prefer to try the combination before creating a DeepSeek key, look for the separate Flash entry marked Free under OpenCode. The provider you select determines which credentials apply, where to check usage and what an error about your balance refers to.
This setup is useful if you maintain a website, build small applications or need help understanding an existing repository. OpenCode supplies the working environment where you open a project and review proposed edits. DeepSeek produces the model responses. You can learn how the connection works in an empty folder. The practice task below comes from a video editor’s workflow and gives you a result you can verify before giving an agent access to a real project.
Which DeepSeek entry should you choose?
Type deepseek in the model selector and look at the provider attached to each entry. The list can contain a direct DeepSeek connection, a model hosted through OpenCode and a model available on the Go plan. The labels are close enough to be confusing. If you added credit to a DeepSeek account yesterday but see a free-model limit today, start by checking the provider on the current session.
| What you want | What to choose | Where usage is accounted for |
|---|---|---|
| Use your own DeepSeek API key | DeepSeek as the provider, then its available Flash or Pro model | DeepSeek Platform |
| Try one exercise without a personal DeepSeek key | The Flash entry marked Free under OpenCode, if listed | OpenCode’s terms for that free model |
| Use a monthly OpenCode subscription | OpenCode Go and a model included with the plan | Your OpenCode Go account |
On November 22, 2026, DeepSeek recommends deepseek-flash as the model ID for its direct API. It currently serves DeepSeek V4.1 Flash. The older deepseek-v4-flash name is still accepted for compatibility. Pro uses deepseek-v4-pro. DeepSeek’s integration walkthrough still mentions a V4 Flash label. For a terminal command, copy the complete ID from the OpenCode catalogue on your computer. For code that calls the DeepSeek endpoint directly, use the ID documented by DeepSeek. DeepSeek’s OpenCode integration · Direct API model names.
Connect your own DeepSeek API key
1. Open an empty working directory. A folder called deepseek-demo is enough. Download the desktop application or follow the CLI installation instructions from OpenCode. The examples here use the terminal client. Run opencode --version, change into the practice folder and start opencode. Commands beginning with a slash in the next steps belong in the OpenCode interface. Install OpenCode · Our first-run guide.
2. Create a provider key. Sign in to DeepSeek Platform, create an API key and check the balance available for API calls. Being able to chat on the DeepSeek website does not establish whether a key exists or whether your API account can fund a request. Give a key for this editor a recognizable name so you can identify the integration when you revisit your account later. DeepSeek Platform · Creating a key and checking its cost.
3. Connect the provider in OpenCode. Enter /connect, search for DeepSeek, select it and paste the key into the credential field. Keep the key out of prompts, application code and configuration examples you share. If the client directs you to buy a Go plan or sign in to the OpenCode Console, check the name of the provider you opened. A valid DeepSeek key belongs with the direct provider.
4. Select the model and send a short request. Enter /models and choose Flash under DeepSeek. Note the selected provider/model pair. Try “Return only the number of seconds in 02:03.” The expected answer is 123. The number checks the response. The selected provider and the corresponding account’s usage record help verify the route. Asking the assistant to identify itself is a poor way to establish where a charge went.
In version 2.3.2, enabling the direct provider exposed deepseek/deepseek-flash and deepseek/deepseek-v4-pro in our catalogue. Once you connect a real key, use the following command for a one-off run against the first model. The model ID is public and can be included in team documentation.
opencode run --model deepseek/deepseek-flash "Return only the number of seconds in 02:03"
Try DeepSeek Flash for free in OpenCode
In a clean profile, run opencode models to list the models available to the current configuration. The free route we used had the ID opencode/deepseek-v4.1-flash-free. If your catalogue lists it, you can make a one-off request with:
opencode run --model opencode/deepseek-v4.1-flash-free "Return only the number of seconds in 02:03"
The --model flag selects a model for that run. If you want it in an existing interactive conversation, select it there with /models. A project default for new work can be set separately in opencode.json or opencode.jsonc. Try an explicit one-off run first. It makes it easier to tell a problem with a saved project default from a choice that was made earlier in the current conversation. How OpenCode selects a model.
The free Flash offer is time-limited. If the Free entry disappears, look up the price before selecting a similarly named model without the suffix. The free route is a convenient way to test a made-up example. For client work, check the processing terms of the provider that actually receives the code. A desktop installation does not establish where inference takes place. OpenCode’s model catalogue and terms.
A first useful task: convert ten video timecodes
Imagine an editor has sent you a chapter list. The player takes seconds, but the spreadsheet contains both minute-second and hour-minute-second labels. In this exercise 60:00 is a valid hour written as sixty minutes. The similar-looking 1:60:00 is invalid because the middle field of an hour-based label has to be between 00 and 59. The distinction gives you more information about the result than a friendly greeting from the model.
Here is the prompt you can paste into the selected session:
Convert these video timecodes to whole seconds. Accept M:SS or H:MM:SS. M in the first format and H in the second may have any number of digits. Seconds and inner minutes must each have exactly two digits between 00 and 59. Trim surrounding spaces. Return null for an invalid entry. Keep the order. Output only a JSON array. Input: ["0:00", "9:07", "00:59", "60:00", "1:02:03", "1:60:00", "02:60", "5:3", " 2:03 ", "01:02:03:04"].
The expected output is [0, 547, 59, 3600, 3723, null, null, null, 123, null]. The fifth entry is 3,600 plus 120 plus 3. The null in an invalid position is important. If the model silently drops that entry, subsequent chapters no longer align with the titles in the spreadsheet. This test is useful both at setup time and after switching a model or provider.
What we verified. On a Mac running OpenCode 2.3.2, we selected the free hosted model in an empty directory, without a personal DeepSeek key. Its first response matched all ten expected values. The client reported a cost of 0 for that call. For the direct-provider connection we used a separate local test endpoint with a dummy credential. OpenCode sent the model ID deepseek-flash and the expected authorization header to /v1/chat/completions and read back a test streaming response. That exercise checked the client configuration. We did not send a paid request to DeepSeek with a personal key.
To apply the exercise to an actual video player, follow up with a different request: “Find the place this project reads a timecode. Propose the smallest change that will pass these ten examples.” You now have an acceptance criterion for a code edit as well. After the change, open the video page and click the 02:03 chapter. It should pass 123 seconds to the player. A correct chat response alone cannot verify that the page calls the right function or that the browser seeks to the right position.
Flash, Pro and the cost of a coding session
Start with Flash for a short task with an easily checked result. If it makes a mistake, point to one failing entry and clarify the rule. Pro is worth trying when the brief is clear but the model struggles to trace several related parts of a project or explain a recurring failure. Keep the task and expected output the same when comparing the two. Changing the prompt, the model and the project all at once makes the comparison hard to interpret.
These are the published off-peak US dollar rates per million tokens on the direct API, checked November 22. Cached input, uncached input and output have separate rates.
| Model | Cached input | Uncached input | Output |
|---|---|---|---|
| Flash | $0.003 | $0.15 | $0.60 |
| Pro | $0.022 | $0.66 | $1.98 |
Suppose a task across several requests consumes 80,000 uncached input tokens, 200,000 cached input tokens and 6,000 output tokens. That comes to $0.0162 on Flash or $0.06908 on Pro. The Flash calculation is 0.08 × 0.15 + 0.20 × 0.003 + 0.006 × 0.60. Published peak rates are double those off-peak rates. This is a worked example for stated token counts. To budget your project, inspect usage after a completed change. An agent may send parts of the repository several times while reading files, running checks and correcting its first answer. DeepSeek pricing and peak hours.
For monthly budgeting, OpenCode offers Go at $10 per month and Go Plus at $40 per month with different usage allowances. Those prices cover OpenCode’s subscription. Buying Go does not add credit to an independent DeepSeek API account. For occasional fixes, collect a week of API costs first, then compare them with the subscription price, model selection and usage limits. OpenCode Go plans.
Troubleshoot the connection before rewriting the prompt
If nothing appears under DeepSeek, use /connect and check the provider in the same project where you open /models. For Model unavailable, compare the complete reference with the current list. Two similar Flash entries may have different prefixes. If it only fails in an older conversation, inspect that session’s selected model. An earlier selection can take precedence over the new project default.
On the direct API, 401 means authentication failed. Check that you entered an API key issued for the intended DeepSeek account and provider. 402 points to insufficient balance: creating another key on the same empty account does not add funds. For 429, pause parallel jobs and retry one request after a delay. 503 indicates service overload. A successful free OpenCode request alongside a 402 from the direct API is entirely possible because the billing routes differ. DeepSeek’s error codes.
FAQ
How do I list the models my DeepSeek key can access?
DeepSeek documents an authenticated GET /models endpoint for its own API. OpenCode’s /models selector shows the choices available in the current project. Record both the provider and the model ID when asking a colleague to diagnose a problem. There is no need to share the secret itself. DeepSeek’s list-models endpoint.
Do I need DeepSeek Harness to use DeepSeek in OpenCode?
No. Harness is a separate working environment with plug-ins. If the goal is to keep OpenCode and change the model, connect a provider in OpenCode. Consider Harness when the assistant interface itself is part of what you want to build, for example a custom panel or a reusable tool. Inside DeepSeek Harness.
Can I switch models and repeat this tomorrow?
Yes. Keep the exact inputs and the expected output together. Start a fresh session, select the model explicitly and repeat the small task. That gives you a basis for comparing answers and costs without trying to reconstruct yesterday’s wording from memory. If the choice is between clients as well, see our Claude Code alternatives comparison.
Tools
Tools
Tools