Install
openclaw skills install @runapi-ai/runapi-deepseekCall the DeepSeek API (deepseek-v4-pro, deepseek-v4-flash) through RunAPI using the official OpenAI SDK, Anthropic SDK, or compatible clients. Use when the user asks for DeepSeek chat, streaming completions, Anthropic Messages compatibility, Gemini contents compatibility, or when they want to point an existing LLM SDK setup at RunAPI as the base URL.
openclaw skills install @runapi-ai/runapi-deepseekDeepSeek on RunAPI exposes OpenAI-compatible Chat Completions and
Anthropic-compatible Messages. Use the OpenAI SDK for most integrations,
or point Anthropic-compatible clients at https://runapi.ai when the existing
application already speaks /v1/messages.
OPENAI_API_KEY=YOUR_RUNAPI_TOKEN
OPENAI_BASE_URL=https://runapi.ai/v1
Get a RunAPI API Key at https://runapi.ai/api_keys.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_RUNAPI_TOKEN",
base_url="https://runapi.ai/v1",
)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_RUNAPI_TOKEN",
baseURL: "https://runapi.ai/v1",
});
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Explain vector databases simply."}],
)
print(response.choices[0].message.content)
print(response.usage)
const response = await client.chat.completions.create({
model: "deepseek-v4-pro",
messages: [{ role: "user", content: "Explain vector databases simply." }],
});
curl -X POST "https://runapi.ai/v1/chat/completions" \
-H "Authorization: Bearer YOUR_RUNAPI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [{"role": "user", "content": "Hello, DeepSeek!"}]
}'
stream = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Write a concise release note."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)
Streaming runs through a regional edge proxy so the request does not hold a Rails/Puma thread. Long generations should always stream.
import anthropic
client = anthropic.Anthropic(
api_key="YOUR_RUNAPI_TOKEN",
base_url="https://runapi.ai",
)
message = client.messages.create(
model="deepseek-v4-pro",
max_tokens=1024,
messages=[{"role": "user", "content": "Draft a migration checklist."}],
)
print(message.content[0].text)
curl -X POST "https://runapi.ai/v1/messages" \
-H "x-api-key: YOUR_RUNAPI_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Summarize this incident."}]
}'
max_tokens is required for Anthropic-compatible requests.
curl -X POST \
"https://runapi.ai/v1beta/models/deepseek-v4-flash:streamGenerateContent" \
-H "x-goog-api-key: YOUR_RUNAPI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{ "role": "user", "parts": [{ "text": "Write a short product FAQ." }] }
]
}'
Use this path only when the caller already expects Gemini contents streaming.
RunAPI bridges this client shape to DeepSeek's OpenAI-compatible chat request
format.
For new app code, prefer the OpenAI-compatible setup.
curl https://runapi.ai/v1/models \
-H "Authorization: Bearer YOUR_RUNAPI_TOKEN"
| Model ID | Use when |
|---|---|
deepseek-v4-pro | Higher quality DeepSeek chat and reasoning tasks |
deepseek-v4-flash | Fast DeepSeek chat |
OPENAI_API_KEY, ANTHROPIC_API_KEY, RUNAPI_TOKEN, or a
secret manager; never inline them in commits or shell history.https://runapi.ai/v1.