OpenClaw で DeepSeek を使う。
DeepSeek V4 は RunAPI を通じて OpenAI 互換と Anthropic 互換の両プロトコルに対応します。スピードには Flash、品質には Pro。組み込みの推論モードはリクエストパラメータで有効化されます——別のモデルスラッグは不要です。RunAPI は DeepSeek トークンを公式の DeepSeek 料金の 50% で価格設定します。
RunAPI を使って OpenAI 互換のチャット補完エンドポイント経由で DeepSeek V4 Pro を呼び出します。
要件:
- RunAPI のチャット補完エンドポイント https://runapi.ai/v1/chat/completions を呼び出します
- model を "deepseek-v4-pro" に設定します
- 認証には RUNAPI_API_KEY 環境変数を使用します
- レスポンスは同期的です——stream パラメータに応じて、返信は SSE イベントとしてストリーミングされるか、単一の JSON オブジェクトとして返されます
- 推論を有効にするには、リクエストボディで thinking.type を "enabled" に設定します
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
}
}
OpenClaw で DeepSeek を使う3ステップ
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 チャット補完パラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
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. |
OpenClaw上のDeepSeekとは?
DeepSeek V4はOpenAI互換のLLMで、OpenClawでのGPTのドロップイン代替として機能します——モデル名を変えるだけで残りはそのままです。リクエストパラメーターによる組み込みの思考連鎖推論をサポートし(別のモデルスラッグ不要)、RunAPIはDeepSeekのすでに低い公式価格の50%で提供し、推論能力を持つモデルの中で最低の1トークンあたりコストになります。
DeepSeekの活用例
高ボリュームアプリ向けバジェットフレンドリーな代替
日次数千のリクエストを処理するアプリのGPTやClaudeをDeepSeekに置き換えます。RunAPIを通じてDeepSeekのすでに低い価格の50%で請求され、OpenAI SDKコードを変更せずにトークンコストが大幅に削減されます。
思考連鎖が見える推論集約タスク
数学・論理・コードデバッグ・計画タスクでThinkingモードを有効にして段階的な推論が精度を向上させます。思考トークンがレスポンスに表示され、モデルの作業を示すUIの構築に役立ちます。
コード生成とデバッグ
コード生成・アルゴリズム実装・デバッグにDeepSeek V4 Proを使用します。コーディングベンチマークで高スコアを取り、GPT-5.5よりも1トークンあたりコストがはるかに低いです。
DeepSeek + OpenClaw のよくある質問
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 で DeepSeek を試す。
無料の RunAPI キーを取得し、OpenClaw で model を deepseek-v4-pro に設定して、利用可能な最低のトークン価格で推論付きのコーディングを始めましょう。