Use DeepSeek in OpenClaw.
DeepSeek V4 serves both OpenAI-compatible and Anthropic-compatible protocols through RunAPI. Flash for speed, Pro for quality. Built-in reasoning mode activates via a request parameter — no separate model slug needed. RunAPI prices DeepSeek tokens at 50% of official DeepSeek rates.
Use RunAPI to call DeepSeek V4 Pro through the OpenAI-compatible chat completions endpoint.
Requirements:
- Call the RunAPI chat completions endpoint at https://runapi.ai/v1/chat/completions
- Set model to "deepseek-v4-pro"
- Use the RUNAPI_API_KEY environment variable for authorization
- The response is synchronous — the reply streams back as SSE events or returns as a single JSON object depending on the stream parameter
- To enable reasoning, set thinking.type to "enabled" in the request body
curl -X POST https://runapi.ai/v1/chat/completions \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function that finds the longest palindromic substring in O(n) time using Manacher algorithm."}
],
"stream": true,
"max_tokens": 4096
}'
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "deepseek-v4-pro",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is Manacher's algorithm implementation..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 356,
"total_tokens": 398
}
}
Use DeepSeek in OpenClaw in three steps
Configure RunAPI as provider
Set the RUNAPI_API_KEY environment variable. In OpenClaw, add RunAPI as an OpenAI-compatible provider with baseUrl https://runapi.ai/v1. DeepSeek works through the same provider you use for GPT or Claude — no separate provider entry needed.
export RUNAPI_API_KEY=runapi_xxx
Select a DeepSeek model
Set the model to deepseek-v4-pro for quality or deepseek-v4-flash for speed. Both use the /v1/chat/completions endpoint. To enable reasoning, pass thinking.type set to enabled — no model slug change required.
model: deepseek-v4-pro
Stream the response
OpenClaw receives the response as an SSE stream in OpenAI chat completions format. Token usage is reported in the final event for billing transparency. The same format works whether you use DeepSeek, GPT, or Claude through RunAPI.
stream: true
DeepSeek chat completions parameters
| Parameter | Type | Description |
|---|---|---|
model |
string |
Required. deepseek-v4-pro or deepseek-v4-flash. |
messages |
array |
Required. Array of message objects with role (system, user, assistant) and content fields. |
stream |
boolean |
Optional. Set to true for SSE streaming. Default false. |
max_tokens |
integer |
Optional. Maximum number of tokens to generate. |
temperature |
number |
Optional. Sampling temperature between 0 and 2. Lower values are more deterministic. |
thinking |
object |
Optional. Set type to "enabled" to activate DeepSeek's built-in reasoning mode. |
What is DeepSeek on OpenClaw?
DeepSeek V4 is an OpenAI-compatible LLM that works as a drop-in replacement for GPT in OpenClaw -- change the model name and everything else stays the same. It supports built-in chain-of-thought reasoning via a request parameter (no separate model slug needed), and RunAPI prices it at 50% of the already-cheap official DeepSeek rates, making it the lowest per-token option for a reasoning-capable model.
DeepSeek use cases
Budget-friendly alternative for high-volume apps
Replace GPT or Claude with DeepSeek for apps that process thousands of requests daily. At 50% of DeepSeek's already low rates through RunAPI, token costs drop significantly without changing your OpenAI SDK code.
Reasoning-heavy tasks with visible chain-of-thought
Enable thinking mode for math, logic, code debugging, or planning tasks where step-by-step reasoning improves accuracy. The thinking tokens are visible in the response, useful for building UIs that show the model's work.
Code generation and debugging
Use DeepSeek V4 Pro for code generation, algorithm implementation, and debugging. It scores well on coding benchmarks and costs a fraction of GPT-5.5 per token.
DeepSeek + OpenClaw questions
Yes. DeepSeek V4 supports the OpenAI chat completions format. Point OpenClaw at RunAPI's /v1 base URL, change the model parameter to deepseek-v4-pro or deepseek-v4-flash, and the rest of your config stays the same. No code changes beyond the model name.
When you enable reasoning (thinking.type set to enabled), DeepSeek generates additional "thinking" tokens that show its chain-of-thought process. These tokens count as output tokens and are billed accordingly. They improve accuracy on complex tasks but increase total token usage.
Flash prioritizes speed with lower latency and cost. Pro prioritizes quality with better performance on complex reasoning, coding, and multi-step tasks. Both use the same endpoint and accept the same parameters.
No. RunAPI proxies DeepSeek through its own infrastructure. Your requests do not route through Chinese data centers, and your API key is never shared with DeepSeek directly.
RunAPI prices DeepSeek tokens at 50% of official DeepSeek rates. DeepSeek is already one of the lowest-cost LLM providers, so through RunAPI you get the lowest per-token price available for a reasoning-capable model. Billing is per-token with no subscription or minimum spend.
OpenClaw general setup
Not configured yet? Start with the RunAPI setup guide for OpenClaw.
OpenClaw setup guide →Try DeepSeek in OpenClaw today.
Get a free RunAPI key, set the model to deepseek-v4-pro in OpenClaw, and start coding with reasoning at the lowest token price available.