Skip to content

Connect to DeepSeek (Recommended)

Estimated time: 5-10 minutes

DeepSeek is great for beginners: direct access (no VPN needed in most regions), simple registration, extremely affordable, and strong coding capabilities.

If you haven't read "What is an API Key", we recommend going back to 1.4 Overview to understand the concepts first.


What You'll Be Able to Do

  • Get a DeepSeek API Key
  • Connect DeepSeek in OpenCode
  • Send your first message and receive a response

🎒 Before You Start

  • [ ] Completed 1.2 Installation and can run opencode
  • [ ] Can access https://platform.deepseek.com

Follow Along

Step 1: Register a DeepSeek Account

Visit: https://platform.deepseek.com

Click "Login/Register" in the top right corner, and follow the prompts to register with your phone number or email.


Step 2: Get Your API Key

Go to the API Keys page:

Create a new Key and copy and save it immediately.

Only shown once!

Most platforms only display the Key once. Once you close the window, you won't be able to see the complete Key again.

Please copy it to a safe place (password manager/notes) immediately. Don't share it in group chats, don't screenshot it, don't commit it to GitHub.


DeepSeek usually gives new users a small amount of credits, but they run out quickly. Adding about 10 CNY worth of credits will last you a long time.


Step 4: Connect DeepSeek in OpenCode

Start OpenCode:

bash
opencode

In the input box, enter:

/connect

Select DeepSeek from the provider list, then paste your API Key.

After success, you'll enter the model selection interface showing DeepSeek's available models (such as deepseek-chat, deepseek-reasoner). Select a model to start chatting.


Step 5: Send Your First Message (Verify Success)

In the input box, enter:

Hello, please introduce yourself

If you receive a response, the connection is successful.


Checklist ✅

  • [ ] Sending messages receives AI responses
  • [ ] No errors (such as API key invalid / insufficient balance / connection timeout)

Common Issues

IssueCauseSolution
API key invalidKey copied incorrectly or has extra spacesCopy again, make sure there are no extra spaces
insufficient balanceInsufficient balanceAdd credits in the console
connection timeoutNetwork fluctuationWait a moment and try again

Next Steps

Having issues?

Stuck during configuration? Join the community to connect with 2000+ fellow learners for real-time support.