EN ▾

Uncensored API for DeepSeek Coder code generation

https://api.deepseekcoderapi.cc/v1uncensored

Get API key

OpenAI Compatible API Configuration: URL, Key, Model

OpenAI compatible api configuration comes down to three values: a base URL, an API key and a model name. Set those, leave the rest of your OpenAI code alone, and the same SDK talks to our endpoint instead.

Updated

Three connector plugs for URL, key and model joining one central socket, illustrating API configuration

Key points

  • Base URL: https://api.deepseekcoderapi.cc/v1. Model ID: uncensored. Auth header: Authorization: Bearer <key>.
  • The official OpenAI SDKs read OPENAI_BASE_URL and OPENAI_API_KEY from the environment, so many apps need no code change.
  • Supported methods are POST /v1/chat/completions and GET /v1/models; embeddings and images are not available.
  • 429 means a limit: rate_limited for requests per minute, concurrency for parallel requests.

The three values

SettingValue
Base URLhttps://api.deepseekcoderapi.cc/v1
API keyThe key from your API key page
Modeluncensored
Auth headerAuthorization: Bearer YOUR_API_KEY

The base URL ends in /v1 and does not include /chat/completions; SDKs add that part themselves. If an app asks for a "full endpoint" instead, use https://api.deepseekcoderapi.cc/v1/chat/completions.

What sits behind it is one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not the official API of any model vendor, and it is not a router across vendors. The docs have a five-minute first request if you want the shortest path.

Python

With the openai package (version 1 or later), pass the values to the client:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepseekcoderapi.cc/v1",
    api_key="YOUR_API_KEY",
)

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "List three uses of a hash map."}],
    max_tokens=300,
)
print(resp.choices[0].message.content)
print(resp.usage)

max_tokens is optional. If you leave it out, the completion can use whatever is left of the 100,000-token window, so set a cap when you want a bounded cost. The usage object gives the token counts you are billed for.

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.deepseekcoderapi.cc/v1",
  apiKey: process.env.API_KEY,
});

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Explain a mutex in one paragraph." }],
});
console.log(resp.choices[0].message.content);

Note the casing: the Node SDK uses baseURL, the Python SDK uses base_url. Mixing them up is a common reason a client silently keeps calling the default host.

curl and environment variables

curl shows you the raw request, which helps when a framework hides it:

curl https://api.deepseekcoderapi.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Say hello."}],
    "stream": false
  }'

Most tools built on the OpenAI SDKs also honour two environment variables, which is the cleanest way to configure software you cannot edit:

export OPENAI_BASE_URL="https://api.deepseekcoderapi.cc/v1"
export OPENAI_API_KEY="YOUR_API_KEY"

Older tools and some libraries use OPENAI_API_BASE instead. If a tool ignores the first name, try the second. Then set the model name inside the tool to uncensored.

Check the connection with the models endpoint

A quick sanity check is GET /v1/models:

curl https://api.deepseekcoderapi.cc/v1/models -H "Authorization: Bearer $API_KEY"

A valid key returns a JSON list containing uncensored. An invalid key returns an error body instead. This call is the best first test because it takes no prompt and the answer tells you whether URL, path and key are all correct. Many clients also call it to populate a model dropdown, so a working result here usually means the dropdown will fill in.

Every chat response carries headers worth logging: X-Request-Id (quote it when you contact support), X-Balance-USD, X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency.

Options that pass through

Standard request fields work as they do with OpenAI: temperature, top_p, stop, seed and the frequency and presence penalties. On top of that you get:

  • Streaming: set stream: true to receive server-sent events, with usage reported at the end.
  • Tool calling: tools, tool_choice, streamed tool_calls, and tool results as role: "tool" messages.
  • JSON mode: response_format: {"type": "json_object"}. Also ask for JSON in your prompt, as you would elsewhere.

The maximum request body is 8 MB. Not available: image, audio or video generation, embeddings and fine-tuning. If your app needs embeddings for search, configure that part with a different provider and keep this one for chat.

A retry wrapper that respects the limits

Production clients should expect the occasional 429. This wrapper reads the Retry-After header when present and otherwise backs off exponentially:

import time
from openai import OpenAI, RateLimitError

client = OpenAI(
    base_url="https://api.deepseekcoderapi.cc/v1",
    api_key="YOUR_API_KEY",
)

def ask(messages, tries=5):
    delay = 2
    for _ in range(tries):
        try:
            return client.chat.completions.create(model="uncensored", messages=messages)
        except RateLimitError as e:
            wait = e.response.headers.get("retry-after")
            time.sleep(float(wait) if wait else delay)
            delay = min(delay * 2, 30)
    raise RuntimeError("still rate limited after retries")

Keep your own worker pool at or below 8 threads for a full key, or 2 for a trial key, so you rarely reach the concurrency limit in the first place. Cap the pool in code instead of relying on retries.

Troubleshooting by status code

  • 401: the key is missing, mistyped or has hidden whitespace. Check that the header reads Bearer, a space, then the key.
  • 404: a wrong path. A doubled /v1/v1 or a missing /v1 are the usual causes. Also check that the model name is exactly uncensored.
  • 429 with code rate_limited: you passed the requests-per-minute cap, which is 300 on a full key and 60 on a trial key.
  • 429 with code concurrency: too many requests at once, 8 on a full key and 2 on a trial key. A stream keeps its slot until it ends.
  • 429 with a Retry-After: 5 header: temporary overload. Wait the five seconds and retry.

A simple retry wrapper that sleeps for Retry-After and otherwise backs off exponentially handles all three cases. Failed requests are not charged, so retries cost nothing extra. If you still need a key, the guide on getting your API key walks through sign-up. Costs are on the pricing page: $0.15 per 1M input and $0.50 per 1M output tokens.

Questions and answers

What base URL should I use?

Use https://api.deepseekcoderapi.cc/v1. SDKs append /chat/completions on their own.

Which model name goes in the config?

Use uncensored, written exactly like that.

Do I need to change my code to switch from OpenAI?

Usually only the base URL, the key and the model name. Features that need embeddings, images or audio are not available here.

Why do I get a 429 error?

You hit a limit. rate_limited means too many requests per minute, concurrency means too many at once, and a Retry-After: 5 header means a brief overload.

Can I stream responses?

Yes. Set stream to true and read the server-sent events. Usage is reported at the end of the stream.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.