Skip to content

How to Set Up OpenClaw with DeepSeek (Cheap Self-Hosted Agent)

Point OpenClaw at DeepSeek for a self-hosted AI assistant that costs cents to run. The config, the OpenAI-compatible endpoint, key handling, and the gotchas.

MGMCSA Guru Team February 19, 2026 5 min read
OpenClaw configured to use the DeepSeek API as its model backend in a terminal

OpenClaw gives you a personal assistant; DeepSeek gives it a cheap brain. That pairing is one of the most practical things you can do with OpenClaw, because the assistant’s whole appeal — running things on a schedule, looping on a task overnight, always being reachable — is also exactly how a premium model quietly drains your account. DeepSeek is one of the cheapest capable APIs around, so it turns an always-on assistant from a cost worry into a rounding error.

This guide connects OpenClaw to DeepSeek: the config, the key handling, which model to pick, and the gotchas. It assumes OpenClaw is already installed — if not, start with the Windows and WSL install guide.

Why this pairing works

DeepSeek exposes an OpenAI-compatible API, which is the format OpenClaw already speaks. That means connecting it is configuration, not engineering — a base URL, a key, a model name. No proxy, no translation layer, no custom adapter. And because OpenClaw is model-agnostic by design, DeepSeek slots in as the brain without changing anything about how the assistant behaves.

Step 1: get a DeepSeek API key

Create an account with DeepSeek and generate an API key from their platform. Note the base URL for the OpenAI-compatible endpoint and the model names from their integration docs. You’ll need three things: the base URL, the key, and a model name.

Step 2: set the key as an environment variable

Keep the key out of config files. In your WSL or Linux shell:

export DEEPSEEK_API_KEY="sk-your-deepseek-key"

To make it persist across sessions, add that line to your shell profile (~/.bashrc or ~/.zshrc) and reopen the terminal.

Step 3: point OpenClaw at DeepSeek

In OpenClaw’s configuration, set the model provider to DeepSeek’s OpenAI-compatible endpoint, reference the key from the environment, and pick a model. Config formats shift between OpenClaw versions, so confirm the current keys in the repo, but the values you’re supplying are always these:

What OpenClaw needs

Base URL DeepSeek's OpenAI-compatible endpoint
API key From $DEEPSEEK_API_KEY (env var)
Model deepseek-chat (general) or the reasoning model

A representative config block looks like this:

{
  "model": {
    "provider": "openai-compatible",
    "base_url": "https://api.deepseek.com",
    "api_key_env": "DEEPSEEK_API_KEY",
    "model": "deepseek-chat"
  }
}

The key idea is provider: openai-compatible plus DeepSeek’s base URL — that’s what tells OpenClaw to talk to DeepSeek in a format it already understands.

Step 4: pick the right model

DeepSeek offers a general chat model and a reasoning model. The split is simple:

  • General model — everyday assistant work: reading files, summaries, messaging, routine automation. Fast and cheapest.
  • Reasoning model — harder, multi-step tasks where the assistant needs to think before acting. Slower and a bit pricier, but still cheap.

Set the general model as your default and switch to reasoning for the occasional hard job. If you later add routing, keep the cheap model as the default and send only hard tasks to the stronger model.

Step 5: test it

Start OpenClaw and give it a task that uses both the model and a capability:

Summarize the README in this folder and tell me what the project does.

If it reads the file and answers sensibly, DeepSeek is wired in correctly. If the model replies but can’t read the file, the model connection is fine and the issue is a skill or permission — not DeepSeek.

OpenClaw + DeepSeek checklist

  • DeepSeek account and API key created
  • Key set as an environment variable (and persisted in your shell profile)
  • OpenClaw model provider set to DeepSeek's OpenAI-compatible endpoint
  • Default model chosen (chat for everyday, reasoning for hard tasks)
  • Tested with a task that touches a file
  • Pricing page bookmarked — rates move

A note on cost

DeepSeek’s rates are low, but “low” still adds up if you put a chatty assistant on a tight schedule. Two habits keep it sane: use the general model as default and reserve the reasoning model for when it’s needed, and don’t schedule jobs more often than you actually use them. Prices on these models shift, so treat any figure you read as a snapshot and confirm on the official pricing page.

Wrapping up

Connecting OpenClaw to DeepSeek is a config change, not a project: set DeepSeek’s OpenAI-compatible base URL, reference your key from an environment variable, pick a model, and test on a real task. The payoff is a self-hosted assistant you can leave running without watching the meter.

From here, if you’d rather pay a flat monthly rate, set up GLM instead. Want zero API cost? Go fully local with Ollama.

Frequently asked questions

Why use DeepSeek with OpenClaw?

Cost. DeepSeek is one of the cheapest capable APIs available, and OpenClaw running an always-on assistant can quietly burn tokens. Pairing the two gives you a self-hosted assistant that costs cents rather than the dollars a premium model would rack up overnight.

Is DeepSeek OpenAI-compatible?

Yes. DeepSeek exposes an OpenAI-compatible API, which is exactly what OpenClaw expects, so connecting it is mostly setting a base URL, an API key, and a model name. No proxy or translation layer is needed.

Where do I put my DeepSeek API key?

In an environment variable, not in a config file you might commit or share. OpenClaw reads the key from the environment, which keeps it out of your files and version control. Treat the key as a credential.

Which DeepSeek model should I pick for OpenClaw?

DeepSeek offers a general chat model and a reasoning model. Use the general one for everyday assistant tasks and the reasoning model for harder, multi-step work. You can switch the model in OpenClaw's config, so try both on your actual workload.

Will DeepSeek match a premium model in OpenClaw?

For most assistant tasks — file work, summaries, messaging, routine automation — it's close enough that the cost saving wins. Expect some gap on the very hardest reasoning. Since OpenClaw is model-agnostic, you can keep DeepSeek as the default and switch up for the occasional hard job.

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.