This integration adds DeepSeek API Platform support to OpenClaw, allowing you to use DeepSeek's state-of-the-art language models including:
- DeepSeek Chat (V3.2): Non-thinking mode with 128K context
- DeepSeek Reasoner (V3.2): Thinking mode with 128K context and extended reasoning capabilities
- Visit DeepSeek Platform
- Create an account and generate an API key
- Copy your API key
Add the following configuration to your openclaw.json file:
{
"models": {
"mode": "merge",
"providers": {
"deepseek": {
"baseUrl": "https://api.deepseek.com",
"apiKey": "${DEEPSEEK_API_KEY:-}",
"api": "openai-completions",
"models": [
{
"id": "deepseek-chat",
"name": "DeepSeek Chat (V3.2)",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0.00000028,
"output": 0.00000042,
"cacheRead": 0.000000028,
"cacheWrite": 0.00000028
},
"contextWindow": 128000,
"maxTokens": 8192
},
{
"id": "deepseek-reasoner",
"name": "DeepSeek Reasoner (V3.2)",
"reasoning": true,
"input": ["text"],
"cost": {
"input": 0.00000028,
"output": 0.00000042,
"cacheRead": 0.000000028,
"cacheWrite": 0.00000028
},
"contextWindow": 128000,
"maxTokens": 65536
}
]
}
}
},
"agents": {
"defaults": {
"models": {
"deepseek/deepseek-chat": {},
"deepseek/deepseek-reasoner": {}
}
}
}
}Create a .env file in your OpenClaw directory:
DEEPSEEK_API_KEY=your-api-key-hereOr export it in your shell:
export DEEPSEEK_API_KEY="your-api-key-here"For persistent API key storage (instead of environment variables), you can add an auth profile using the included script:
./add-deepseek-auth.sh "your-api-key-here"This stores your API key securely in OpenClaw's auth profiles and allows you to use DeepSeek models without setting environment variables.
openclaw models list | grep deepseekYou should see:
deepseek/deepseek-chat text 128k no yes configured
deepseek/deepseek-reasoner text 128k no yes configured
openclaw models set deepseek/deepseek-reasoner| Model | ID | Reasoning | Context Window | Max Output | Input Types | Cost (per token) |
|---|---|---|---|---|---|---|
| DeepSeek Chat | deepseek-chat |
false |
128,000 | 8,192 | Text | Input: $0.00000028, Output: $0.00000042 |
| DeepSeek Reasoner | deepseek-reasoner |
true |
128,000 | 65,536 | Text | Input: $0.00000028, Output: $0.00000042 |
Note: Cache read/write costs are included for accurate token usage tracking.
- ✅ OpenAI API Compatibility: Uses DeepSeek's OpenAI-compatible API
- ✅ Thinking Mode Support: Full support for DeepSeek Reasoner's reasoning capabilities
- ✅ Accurate Cost Tracking: Per-token pricing for both models
- ✅ Environment Variable Security: API key stored securely in environment variables
- ✅ Auth Profile Support: Optional persistent API key storage in OpenClaw auth profiles
- ✅ Automatic Detection: Models appear in
openclaw models listautomatically
openclaw models set deepseek/deepseek-reasoneropenclaw models set deepseek/deepseek-chatopenclaw models list --provider deepseekMake sure you've set the environment variable:
export DEEPSEEK_API_KEY="your-api-key"- Verify your
openclaw.jsonconfiguration is valid:openclaw doctor
- Check that the provider is properly configured in
models.providers - Ensure models are added to
agents.defaults.modelsallowlist
- Verify your API key is valid and has sufficient credits
- Check DeepSeek API status: https://status.deepseek.com/
- Ensure you're using the correct base URL:
https://api.deepseek.com
If you need to use a different endpoint (e.g., for compatibility):
"baseUrl": "https://api.deepseek.com/v1"Add custom aliases for easier reference:
"agents": {
"defaults": {
"models": {
"deepseek/deepseek-chat": {
"alias": "DeepSeek"
},
"deepseek/deepseek-reasoner": {
"alias": "DeepSeek Thinking"
}
}
}
}For users who prefer plugin-based integration, an experimental OpenClaw plugin is included in the plugin/ directory.
- Programmatic provider registration
- Potential for future enhancements (API key management, etc.)
cd plugin
npm install
npm run build
openclaw plugins enable ./path/to/pluginNote: The configuration-based approach is recommended for most users. The plugin is experimental and may require additional development.
MIT License - See LICENSE file for details.
- OpenClaw Documentation: https://opencode.ai
- DeepSeek API Documentation: https://api-docs.deepseek.com
- Issues: Please file GitHub issues for bugs or feature requests