DeepSeek Uncensored API: Setup in a Few Lines of Code
You can point an existing OpenAI client at this endpoint by changing two values. Below are working examples in Python, Node and curl, plus streaming, tools and the errors you will meet first.
Last updated

What you need
Setting up a deepseek uncensored api style connection takes three values. The service is independent and is not the official DeepSeek API, so the key comes from this site, not from a vendor console.
- Base URL:
https://api.deepseekuncensored.com/v1 - Model ID:
uncensored - Key: sent as
Authorization: Bearer <key>
Get a key on the API key page. After sign-up with Google, or with email and password, you can claim $0.50 of trial credit with one click. It needs no card and is valid for 7 days. Keep the key in an environment variable and never in front-end code.
First request with curl
A curl call is the fastest way to confirm that the key and network path work before you touch application code.
curl https://api.deepseekuncensored.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Say hello in five words."}]
}'A successful reply carries the usual choices array. The response headers also include X-Request-Id and X-Balance-USD, which shows your remaining credit after the call. You can list models with GET /v1/models; expect the single ID uncensored.
Python with the OpenAI SDK
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.deepseekuncensored.com/v1",
api_key=os.environ["API_KEY"],
)
resp = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You write dark, gritty fiction for adult readers."},
{"role": "user", "content": "Outline a heist thriller in five beats."},
],
temperature=0.8,
max_tokens=600,
)
print(resp.choices[0].message.content)
print(resp.usage)max_tokens is optional. If you leave it out, the completion may use whatever remains of the 100,000-token window, which covers prompt and completion together. Set it when you want a predictable bill. Sampling settings such as temperature, top_p, stop, seed and the penalties are passed through.
Responses endpoint and popular clients
Besides chat completions, the API accepts POST /v1/responses, which some newer OpenAI clients use by default. A minimal call looks like this:
curl https://api.deepseekuncensored.com/v1/responses \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"input": "List three plot twists for a space western."
}'Many tools only need the base URL, the key and the model name:
- SillyTavern lets you add an OpenAI-compatible endpoint as a custom chat source.
- Open WebUI accepts an OpenAI-compatible connection with a base URL and key.
- LangChain and similar libraries expose a
base_urloption on their OpenAI chat classes.
If a tool insists on a model list, call GET /v1/models. If it asks for a model name by hand, type uncensored in lowercase.
Node.js
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.deepseekuncensored.com/v1",
apiKey: process.env.API_KEY,
});
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Give me three names for a noir bar." }],
});
console.log(resp.choices[0].message.content);Frameworks that accept a custom OpenAI base URL, such as chat front ends or agent libraries, work the same way. Paste the base URL and key into their settings and type uncensored as the model name.
Streaming, JSON mode and tools
Streaming
Set stream: true to receive server-sent events. Usage is sent at the end of the stream. A streamed request holds its concurrency slot until the stream finishes, so close streams you no longer need.
from openai import OpenAI
client = OpenAI(base_url="https://api.deepseekuncensored.com/v1", api_key="YOUR_KEY")
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell a short story about a lighthouse."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)JSON mode
Pass response_format={"type": "json_object"} and mention JSON in the prompt. Validate the result in your code, because any model can produce malformed output on a bad day.
Tool calling
Send tools and optionally tool_choice. When the model returns tool_calls, run the function and send the result back as a message with role: "tool". Streamed tool_calls are supported too.
A complete tool-calling round trip
Tool calling takes two requests. First you describe the function and the model answers with a call. Then you run it and send the result back.
import json
from openai import OpenAI
client = OpenAI(base_url="https://api.deepseekuncensored.com/v1", api_key="YOUR_KEY")
tools = [{
"type": "function",
"function": {
"name": "roll_dice",
"description": "Roll a die with the given number of sides",
"parameters": {
"type": "object",
"properties": {"sides": {"type": "integer"}},
"required": ["sides"],
},
},
}]
messages = [{"role": "user", "content": "Roll a twenty-sided die for my attack."}]
first = client.chat.completions.create(model="uncensored", messages=messages, tools=tools)
call = first.choices[0].message.tool_calls[0]
messages.append(first.choices[0].message)
messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps({"result": 17})})
final = client.chat.completions.create(model="uncensored", messages=messages, tools=tools)
print(final.choices[0].message.content)Keep the history on your side
As with any chat completions API, continue a conversation by sending the full list of messages every time. This is why long chats get more expensive per turn: the whole history counts as input tokens. Trim or summarise old messages once a chat grows past what the story needs.
Limits and error handling
A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 concurrent requests and 60 per minute. The maximum body size is 8 MB.
| Status | Meaning | What to do |
|---|---|---|
429, code rate_limited | Too many requests per minute | Back off and spread calls out |
429, code concurrency | Too many requests at once | Queue calls in your client |
429 with Retry-After: 5 | Temporary overload | Wait 5 seconds and retry |
import time
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.deepseekuncensored.com/v1", api_key="YOUR_KEY")
def ask(messages, tries=4):
for attempt in range(tries):
try:
return client.chat.completions.create(model="uncensored", messages=messages)
except RateLimitError:
time.sleep(5 * (attempt + 1))
raise RuntimeError("still rate limited")The headers X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency tell you the limits that apply to your key. Failed requests are not charged.
Production habits that save you trouble
- Set a client timeout. Long generations can take a while, so give streaming requests a generous read timeout and a short connect timeout.
- Keep keys per environment. Accounts that have topped up can hold up to 5 labelled keys, so use one for development and one for production and revoke either on its own.
- Log the request ID. Every response carries
X-Request-Id. Store it next to your own record so a support question can name an exact call. - Watch the balance header.
X-Balance-USDcomes back on each response, which makes a low-credit alert a few lines of code. - Cap output. A sensible
max_tokenskeeps one runaway answer from eating budget.
None of these need special setup. They are the same habits you would use with any hosted API.
Checklist for a first working integration
Most failed first calls come from a handful of mistakes. Run through this list before you debug anything deeper.
- Base URL ends in
/v1. Usehttps://api.deepseekuncensored.com/v1exactly. Clients append/chat/completionsthemselves, so do not add it to the base URL. - Model is the string
uncensored. Names from other providers will not match. - Key goes in the Bearer header. Check for a stray space or newline when you paste it from the key page.
- Environment variable is actually set. In Python,
os.environ["API_KEY"]raises aKeyErrorwhen it is missing, which points straight at the cause. - One request works before you add concurrency. Test a single call, then raise parallelism up to the 8 concurrent requests a full key allows (2 on a trial key).
- Balance is above zero. Read
X-Balance-USDon a response, or callGET /v1/balance. Trial credit expires after 7 days.
If the call works in curl but not in your app, compare the two requests. The usual difference is the URL or a header that your HTTP library rewrites.
Cost and next steps
Billing is $0.15 per 1M input tokens and $0.50 per 1M output tokens from prepaid credit. A call with 800 prompt tokens and 300 completion tokens costs 0.00012 + 0.00015 = $0.00027, so about 3,700 such calls fit into one dollar. Top-ups run from $20 to $500 in whole dollars, paid in crypto (USDT on TRC20 or USDC on Base). See the pricing page for bonus tiers and the docs for the full parameter list.
If you are new to the topic, the plain-language myths and facts article explains what "uncensored" does and does not change.
More guides
Common questions
Which model ID do I send?
Use uncensored. It is the only model on the endpoint, and GET /v1/models lists it.
Does the OpenAI SDK work unchanged?
Yes. Set the base URL to https://api.deepseekuncensored.com/v1 and use your key; chat completions, responses, streaming and tool calling follow the OpenAI shape.
Can I check my balance from code?
Yes. Call GET /v1/balance or the OpenAI-style credit_grants endpoint, or read the X-Balance-USD header on any response.
Is this the official DeepSeek API?
No. It is an independent service running an open-weight model, not the official API of any vendor.
Get your API key
Sign up, copy the key, update the base URL. That is all it takes.
https://api.deepseekuncensored.com/v1