Skip to content
Guide

Setting up DeepSeek

Low-cost DeepSeek models, with an API key and a prepaid balance.

On this page

DeepSeek makes low-cost models with long context. This guide covers getting a DeepSeek API key, topping up, and connecting it to Aldwin.

What DeepSeek is#

DeepSeek's API gives you its models, billed per use from a balance you top up. Prices are lower outside peak hours.

When Aldwin uses DeepSeek, your prompts and the files Aldwin reads for you go to DeepSeek over the internet. If you want everything to stay on your computer, use Ollama or LM Studio instead.

What you need#

  • A DeepSeek platform account and API key
  • A topped-up balance (the API is prepaid)
  • Aldwin installed (uv tool install aldwin)

Each request is charged from your balance. See DeepSeek pricing.

Get a key#

  1. Sign in to the DeepSeek platform.
  2. Top up your balance.
  3. Open API keys and create a key.
  4. Copy the key now; it is shown only once. Treat it like a password.

Connect Aldwin#

In the web app#

  1. Open Settings from the bottom of the sidebar and choose Models.
  2. Find DeepSeek under Providers and select Add key.
  3. Paste your key and select Connect. Aldwin checks the key with DeepSeek before saving it. If it does not work, Aldwin says why and saves nothing.
  4. Under Model in use, pick a DeepSeek model. You can also switch models from the message box in any chat.

Setting up Aldwin for the first time? On the Connect a model page, pick Paste an API key, choose DeepSeek, and paste the key.

To change or remove the key later, use Replace key or Disconnect on the same row.

In the terminal#

  1. Start Aldwin and type /model.
  2. Pick Add a provider… and press Enter. It lists the cloud providers that don't have a key yet.
  3. Pick DeepSeek, then paste your key at DeepSeek API key: (the input is hidden) and press Enter.
  4. Aldwin checks the key with DeepSeek before saving it. When it works you see ✓ Saved key for DeepSeek. If not, Aldwin says why and saves nothing.
  5. DeepSeek now appears under Available providers. Pick it, then pick a model. You see ✓ Switched to <model> (DeepSeek).

Aldwin's key check lists your models, which works even with an empty balance. If the key connects but every message fails with HTTP 402, top up.

On first launch, aldwin offers the same choice: choose to use a cloud provider, pick DeepSeek, and paste the key. You can rerun this any time with aldwin setup.

Choosing a model#

DeepSeek lists two models, both with tools: deepseek-flash is fast and cheap, deepseek-v4-pro is stronger.

To switch straight to a model by name, type /model deepseek/deepseek-flash.

Update or remove the key#

Type /model, choose Manage keys…, and pick DeepSeek. Update key checks and saves a new key. Disconnect removes the saved key; switch to another model first if DeepSeek runs the current one.

Other ways to add the key#

These skip the check, so use them only if you prefer files or environment variables.

Secrets file. Add this line to ~/.aldwin/secrets.yaml (create the file if it does not exist, and keep any lines already in it):

deepseek_api_key: your-key-here

Environment variable, for one terminal session or in your shell profile (~/.zshrc or ~/.bashrc):

export DEEPSEEK_API_KEY=your-key-here

An environment variable wins over a saved key.

Try it#

aldwin

Ask something that uses a tool:

List the files in this folder.

You should see a list_dir step and then the answer. The status line at the bottom shows your model and DeepSeek.

Privacy notes#

  • DeepSeek stores data in China, and its privacy policy lists model training as a use. See the DeepSeek privacy policy. Avoid sending it files you would not want stored there.
  • Aldwin keeps the key only in ~/.aldwin/secrets.yaml (or your environment), and removes it from any error message it shows.
  • Details: Privacy.

Troubleshooting#

Messages from /model appear right after you paste a key. Messages during a chat appear after ✗ in place of an answer.

What Aldwin saysFix
Your DeepSeek key was rejected. Check the key and try again.The key is wrong, revoked, or was pasted with extra characters. Copy it again from DeepSeek.
Could not reach DeepSeek to verify the key.Check your internet connection and try again. If it keeps happening, the account may be blocked or out of credit; check it on the provider's site.
DeepSeek runs the current model. Switch to another model first.You can't disconnect the provider you are using. Switch model with /model, then disconnect DeepSeek.
DeepSeek's key comes from DEEPSEEK_API_KEY in your environment. ...Disconnect can't remove an environment variable. Delete the export DEEPSEEK_API_KEY=... line from your shell profile, then restart Aldwin.
Your DeepSeek key was rejected. Run `aldwin setup` to replace it.The key stopped working after it was saved. Run /model, choose Manage keys…, pick DeepSeek, and choose Update key.
DeepSeek refused the request (HTTP 402). ...Your balance is used up. Top up on the DeepSeek platform.
DeepSeek rate limit reached. Wait a moment and try again.Too many requests at once. Wait a minute and try again.
Can't reach DeepSeek. ...Check your internet connection, or switch to a local model with /model.
Model ... isn't available to your key. ...Your account can't use that model. Pick another with /model.
This conversation is too long for ... Start a fresh one with /new.Type /new. Your saved memory notes stay.
Was this page helpful?