DeepSeek Provider Setup: API Key and Model Selection
Set up the DeepSeek provider with your API key and choose a default model through onboarding. This page covers installing the plugin, generating a key, and verifying available models.
Read this when
- You want to use DeepSeek with OpenClaw
- You need the API key env var or CLI auth choice
DeepSeek offers capable AI models behind an API that is compatible with OpenAI.
| Property | Value |
|---|---|
| Provider | deepseek |
| Auth | DEEPSEEK_API_KEY |
| API | OpenAI-compatible |
| Base URL | https://api.deepseek.com |
Install plugin
Add the official plugin:
openclaw plugins install @openclaw/deepseek-provider
If a Gateway is already running, the installation is applied to it right away; if not, it takes effect the next time the Gateway starts. See Apply changes and inspect.
Getting started
Get your API key
Generate an API key on platform.deepseek.com.
Run onboarding
openclaw onboard --auth-choice deepseek-api-key
You are asked for your API key, and deepseek/deepseek-v4-pro is set as the default model.
Verify models are available
openclaw models list --provider deepseek
To look at the plugin's static catalog when no Gateway is running:
openclaw models list --all --provider deepseek
Model entries you already have are kept by onboarding, and generated catalog rows are left to discovery. When models.mode: "replace" is used, the built-in catalog is written as well, since discovery is skipped in that mode.
Non-interactive setup
For headless or scripted setups, supply every flag on the command line:
openclaw onboard --non-interactive \
--mode local \
--auth-choice deepseek-api-key \
--deepseek-api-key "$DEEPSEEK_API_KEY" \
--skip-health \
--accept-risk
Warning
When Gateway is run as a daemon (launchd/systemd), confirm that
DEEPSEEK_API_KEYcan be reached by that process (for instance, in~/.openclaw/.envor throughenv.shellEnv).
Built-in catalog
| Model ref | Name | Input | Context | Max output | Notes |
|---|---|---|---|---|---|
deepseek/deepseek-flash | DeepSeek V4.1 Flash | text, image | 1,000,000 | 384,000 | Main Flash model |
deepseek/deepseek-v4-flash | DeepSeek V4 Flash | text | 1,000,000 | 384,000 | Fast V4 thinking-capable surface |
deepseek/deepseek-v4-pro | DeepSeek V4 Pro | text | 1,000,000 | 384,000 | Onboarding default |
deepseek/deepseek-v4-flash-vision-exp | DeepSeek V4 Flash Vision (Experimental) | text, image | 1,000,000 | 384,000 | Experimental image understanding |
Warning
On July 24, 2026 at 15:59 UTC, DeepSeek retired
deepseek-chatanddeepseek-reasoner. Those model IDs can no longer be reached. Point any configured model refs atdeepseek/deepseek-v4-flashordeepseek/deepseek-v4-proinstead.
Costs shown locally by OpenClaw are estimates. Peak DeepSeek rates are what deepseek/deepseek-flash applies: $0.30 per million input tokens, $1.20 per million output tokens, and $0.006 per million cached input tokens. The published off-peak rates are half of those figures. Earlier bundled metadata is kept for legacy rows. deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted by DeepSeek, routed to V4.1 Flash, and billed at the current Flash rates. Selections you made explicitly stay valid in OpenClaw. Rates can change on DeepSeek's side; billing is governed by its Models & Pricing page.
For image inputs, pick deepseek/deepseek-flash. Image support is also kept by the legacy deepseek/deepseek-v4-flash-vision-exp selection. Through the same API and API key, deepseek/deepseek-flash accepts PNG, JPEG, GIF, and WebP images. Image limits are covered in DeepSeek vision.
Tip
DeepSeek's
thinkingcontrol is supported by Flash and V4 models. On follow-up turns OpenClaw also replays DeepSeekreasoning_content, which lets thinking sessions that make tool calls keep going. To request DeepSeek's maximumreasoning_effort, use/think xhighor/think maxwith DeepSeek V4 models; both of them map to"max".
Thinking and tools
Sometimes a DeepSeek model outputs DSML tool markup as plain text, whether directly or via OpenRouter or another OpenAI-compatible provider. In that case OpenClaw turns valid calls, tool_calls, tool_call, and function_calls blocks into tool calls rather than displaying their payloads in chat. Doubled fullwidth markers with a separator space are included. When calls go directly to the provider, or during tool-free finalization, these blocks are hidden and no tools are recovered. Blocks that are malformed or unfinished are hidden too and never executed; recovered calls are still subject to the tool permissions already in place. If a response carries both native tool calls and DSML, the native calls win, so recovered duplicates are not executed. Reasoning requests keep OpenRouter's own format when routing goes through OpenRouter.
In DeepSeek V4 thinking sessions, replayed assistant messages from a thinking-enabled turn must carry reasoning_content on follow-up requests. The DeepSeek plugin in OpenClaw fills that field in for you, so ordinary multi-turn tool use works on deepseek/deepseek-flash, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp, and deepseek/deepseek-v4-pro even if the history originated from a different OpenAI-compatible provider (with no native reasoning_content) or from a plain assistant message. Switching providers mid-session needs no /new.
With thinking turned off (the UI None selection included), OpenClaw sends thinking: { type: "disabled" } and removes replayed reasoning_content from the outgoing history, so the session stays on DeepSeek's non-thinking path.
A fresh onboarding picks deepseek/deepseek-v4-pro. To choose Flash:
openclaw models set deepseek/deepseek-flash
Live testing
To execute just the DeepSeek V4 direct-model checks from the modern model live suite:
OPENCLAW_LIVE_PROVIDERS=deepseek \
OPENCLAW_LIVE_MODELS="deepseek/deepseek-v4-flash,deepseek/deepseek-v4-pro" \
pnpm test:live src/agents/models.profiles.live.test.ts
This confirms that both V4 models finish, and that thinking and tool follow-up turns keep the replay payload that DeepSeek requires.
To exercise the experimental vision model with the same DEEPSEEK_API_KEY:
OPENCLAW_LIVE_DEEPSEEK_MODEL=deepseek-v4-flash-vision-exp \
pnpm test:live extensions/deepseek/deepseek.live.test.ts
Text, generated-image recognition, and thinking replay checks then run against whichever model you selected.
Config example
{
env: { vars: { DEEPSEEK_API_KEY: "sk-..." } },
agents: {
defaults: {
model: { primary: "deepseek/deepseek-v4-pro" },
},
},
}
Related
-
Model selection, Picking providers, model refs, and how failover behaves.
-
ds4 local server, Serving DeepSeek V4 Flash from a local OpenAI-compatible ds4 server.
-
Configuration reference, Complete config reference covering agents, models, and providers.
Web search
Any model can get web_search from this same plugin. Queries go straight to DeepSeek's search engine rather than through a chat completion. After installing the plugin as described above, pick DeepSeek under Settings → Search, or set openclaw configure --section web.
{
tools: {
web: {
search: { provider: "deepseek" },
},
},
plugins: {
entries: {
deepseek: {
config: {
webSearch: {
apiKey: "YOUR_DEEPSEEK_API_KEY", // pragma: allowlist secret
},
},
},
},
},
}
When DEEPSEEK_API_KEY exists in the Gateway environment or models.providers.deepseek.apiKey is configured, the key becomes optional. Credentials resolve in this order: the plugin search key first, then the environment key, then the model-provider key. Both the plugin search key and the model-provider fallback can use SecretRefs via the standard secret preparation flow. Keys held only in model auth profiles are not reused for search.
Once DeepSeek is the selected search provider, swapping its search key or SecretRef hot-applies through the Gateway's secrets runtime; no plugin replacement is needed and no unrelated agent turns have to wait. Enabling the plugin and explicit plugin reloads still follow normal lifecycle settlement.
Absent an explicit search provider, credential auto-detection evaluates DeepSeek after Parallel (order 80) and ahead of configured endpoint providers. Set provider: "deepseek" if you want to block automatic fallback to a different search service.
Calls to search always go to https://api.deepseek.com/v1/tools/search; a chat base URL you have configured will not reroute search or its credential through a proxy.
Queries and results
query: 1, 128 Unicode characters. Queries above that size are rejected outright, never truncated.count: 1, 10 results, with a default oftools.web.search.maxResultsor 5.- Query operators such as
site:,-site:,lang:,after:,before:, and quoted phrases go directly inquery. Separate structured filter parameters are unsupported: supplying them returns an error instead of being silently ignored. - Each result carries a title, URL, model-oriented summary (short snippets serve as the fallback), publication date, and site name. Core validates URLs and dates, then wraps returned prose as untrusted web content. No full page content is fetched.
await web_search({
query: "OpenClaw site:github.com lang:en after:2026-10-01",
count: 5,
});
Timeouts and cache settings are shared with other providers. The cache key separates entries by query, result count, and credential. The DeepSeek adapter neither caches errors nor retries them automatically.
Per DeepSeek's documentation, each account is limited to 5 search requests per second, and pricing is $0.75 per 1,000 successful non-empty search requests. Empty results and failed requests incur no charge. Current pricing and account limits are listed at DeepSeek Search & Fetch. This plugin integration adds search only; web_fetch keeps using its existing local extraction and configured fallbacks.