BASE URL
https://devseek.space/v1
DOCS · v2
devseek speaks the OpenAI Chat Completions protocol. Any OpenAI SDK works once you change the base URL.
BASE URL
https://devseek.space/v1
AUTH
Authorization: Bearer dsk-…
MODEL
deepseek-v4.1-flash-free
224K tokens · 64K tokens
curl https://devseek.space/v1/chat/completions \
-H "Authorization: Bearer $DEVSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-free",
"stream": true,
"messages": [{"role": "user", "content": "Write a binary search in Rust"}]
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DEVSEEK_API_KEY"],
base_url="https://devseek.space/v1",
)
stream = client.chat.completions.create(
model="deepseek-v4.1-flash-free",
messages=[{"role": "user", "content": "Write a binary search in Rust"}],
max_tokens=4096,
stream=True,
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.DEVSEEK_API_KEY,
baseURL: "https://devseek.space/v1",
});
const stream = await client.chat.completions.create({
model: "deepseek-v4.1-flash-free",
messages: [{ role: "user", content: "Review this diff for bugs" }],
stream: true,
});
for await (const c of stream) process.stdout.write(c.choices[0]?.delta?.content ?? "");from openai import OpenAI
client = OpenAI(api_key=KEY, base_url="https://devseek.space/v1")
tools = [{"type": "function", "function": {
"name": "run_tests",
"description": "Run the test suite and return failures",
"parameters": {"type": "object",
"properties": {"path": {"type": "string"}},
"required": ["path"]}}}]
r = client.chat.completions.create(
model="deepseek-v4.1-flash-free", tools=tools,
messages=[{"role": "user", "content": "Tests in src/ fail. Investigate."}])
print(r.choices[0].message.tool_calls)# opencode.json — add devseek as an OpenAI-compatible provider
{
"provider": {
"devseek": {
"npm": "@ai-sdk/openai-compatible",
"options": { "baseURL": "https://devseek.space/v1", "apiKey": "{env:DEVSEEK_API_KEY}" },
"models": { "deepseek-v4.1-flash-free": { "limit": { "context": 224000, "output": 65536 } } }
}
}
}
# aider
export OPENAI_API_BASE=https://devseek.space/v1 OPENAI_API_KEY=$DEVSEEK_API_KEY
aider --model openai/deepseek-v4.1-flash-free
| Route | What it does | Notes |
|---|---|---|
GET /v1/models | List models | Needs a key |
POST /v1/chat/completions | Chat, streaming or not, with tools | stream: true for SSE; a usage chunk comes last |
GET /api/status | Public status JSON | No key |
GET /health | Liveness | No key |
Input is limited to 224K tokens and output to 64K tokens. We estimate input size from the request bytes (about 3.3 bytes per token) before calling the model, so a request near the limit may be refused a little early.
A session is one chat completion request that has started and not yet finished. Your level sets how many sessions may run at once:
Over your limit you get:
HTTP/1.1 429 Too Many Requests
Retry-After: 1
{"error":{"message":"Level 1 allows 3 concurrent sessions; 3 are already running. …",
"type":"rate_limit_error","code":"session_limit_reached",
"level":1,"session_limit":3,"sessions_in_use":3}}
Any tool that accepts an OpenAI-compatible provider works. Use the base URL, your key and the model ID below. Keep parallel tool workers at or below your session limit.
| Status / code | Meaning | What to do |
|---|---|---|
401 missing_api_key / invalid_api_key | Missing or wrong key | Send Authorization: Bearer dsk-… |
400 invalid_json / invalid_messages | Malformed body or messages | Fix the request; do not retry as is |
400 context_length_exceeded | Input over 224K tokens | Shorten or summarise the conversation |
404 model_not_found | Unknown model | Use deepseek-v4.1-flash-free |
413 body_too_large | Body over 4 MB | Send less context |
429 session_limit_reached | Too many concurrent sessions | Wait for a request to finish, then retry |
503 upstream_saturated / upstream_busy | devseek or the model is at capacity | Retry after the Retry-After header |
502 upstream_error | The model backend failed | Safe to retry |