OPENCLAW + DEEPSEEK

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.

one API key · OpenAI + Anthropic protocols · streaming support
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
  }
}
Copy the curl command to test deepseek
HOW IT WORKS

Use DeepSeek in OpenClaw in three steps

1

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
2

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
3

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
PARAMETERS

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.

FAQ

DeepSeek + OpenClaw questions

OpenClaw general setup

Not configured yet? Start with the RunAPI setup guide for OpenClaw.

OpenClaw setup guide →

DeepSeek model catalog

See DeepSeek V4 variants, pricing, and API docs.

DeepSeek models →

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.