Create key

Integrate the API in Minutes

Drop our uncensored API into your existing codebase and bypass content refusals instantly. This quickstart guides you through setting up the base URL, sending your first request, and handling streaming responses with zero friction.

Create key

Installation & Base URL Setup

Configure your client to point at our OpenAI-compatible endpoint immediately.

Our API resides at https://api.codedeepseek.cc/v1. You only need to change the base_url and provide your API key. This setup works with the official SDKs for Python and Node.js, ensuring your existing code remains intact. No complex routing or proxy configuration is required.

Sign up via Google or email to receive your key instantly. There is no phone number required, and the key appears on the screen right away. This simplicity lets you focus on integration rather than administrative hurdles.

Authentication

Include your key in the Authorization header for every request. The header format is standard: Authorization: Bearer YOUR_API_KEY. We do not use query parameters for authentication, keeping your URLs clean and secure.

One active key per account ensures clear usage tracking. If you need a new key, generating one replaces the old one immediately. This feature is useful for rotating credentials in production environments without downtime.

Sending Your First Request

Make a standard chat.completions call to generate text from the uncensored model.

Use the model ID uncensored for all requests. This open-weight model runs on our servers and does not refuse lawful adult, fictional, or controversial topics. It is designed for developers who want unrestricted output for coding and creative tasks.

The following example demonstrates a basic request using cURL. Replace YOUR_API_KEY with your actual key.

curl https://api.codedeepseek.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Fix the null pointer in the java service class"}]
  }'

Ensure your request body includes a messages array with at least one user message. The API expects text input and returns text output. This simplicity allows for rapid prototyping without worrying about complex payload structures.

You can test the endpoint directly in your terminal or script. This immediate feedback loop helps you verify connectivity before integrating into larger applications.

Streaming Responses with SSE

Enable real-time token generation by setting stream: true in your request.

Server-Sent Events (SSE) deliver tokens as they are generated, reducing perceived latency for long outputs. The final chunk in the stream contains the total token usage for the request. This feature is essential for chat interfaces where users expect instant responses.

from openai import OpenAI

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

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

Handle the stream by iterating through the response objects. Each object represents a single token or delta. You can concatenate these deltas to build the full response text. This approach keeps your application responsive even under heavy load.

Streaming is supported for all model responses. Use it to enhance user experience in coding assistants or content generation tools. The uncensored model handles long contexts efficiently, ensuring smooth streaming even for extensive outputs.

Function Calling & Tools

Integrate external tools by defining functions in your request payload.

The API supports standard OpenAI-style function calling. Define your tools in the tools parameter and let the model decide when to invoke them. This capability enables complex workflows like code execution or data retrieval.

import OpenAI from "openai";

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

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);

Specify the function name and description clearly. The model will return a function call object if it determines the tool is necessary. You then execute the function and feed the result back into the conversation.

This feature is particularly useful for coding agents that need to run code snippets or fetch documentation. The uncensored model understands context well, reducing false positives in tool selection.

Ensure your tool definitions match the expected input schema. Mismatches can lead to errors or unexpected behavior. Test your tool integration thoroughly before deploying to production.

JSON Mode for Structured Output

Force the model to output valid JSON by setting response_format to {"type": "json_object"}.

This mode is ideal for applications requiring structured data, such as configuration files or API responses. The model will attempt to conform to JSON syntax, reducing the need for post-processing.

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Tell the story in second person."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Use JSON mode in conjunction with streaming for real-time structured data delivery. This combination is powerful for building dynamic web applications that consume API data.

While JSON mode improves structure, it may occasionally produce invalid JSON if the prompt is ambiguous. Always validate the output in your application code. This extra step ensures reliability in production environments.

The uncensored model handles complex JSON structures effectively. Use it for generating code snippets, configuration objects, or data transformations.

Parameters: Temperature, Top-P, and Seed

Control the randomness and reproducibility of your outputs using standard parameters.

Set temperature between 0 and 2 for varying creativity. Lower values produce more deterministic results, while higher values increase randomness. Use top_p for nucleus sampling, which limits the probability mass of considered tokens.

The seed parameter allows for reproducible outputs. Set a specific seed value to get the same response across multiple calls. This is useful for debugging and testing.

Combine these parameters to fine-tune the model's behavior for your specific use case. For example, use a low temperature and a fixed seed for code generation where consistency is key.

Experiment with different settings to find the optimal balance for your application. The API supports all standard OpenAI parameters, ensuring compatibility with existing tools.

Frequently asked questions

What is the context window limit for the uncensored model?

The context window is 100,000 tokens, covering both the prompt and the completion. This allows for extensive conversations and large code files. Max output per request is 16,000 tokens, or 2,048 if max_tokens is not set.

How do I handle errors like rate limits or insufficient credit?

A 401 error indicates an invalid API key. A 402 error means you have insufficient prepaid credit. A 429 error signifies you have hit the rate limit of 300 requests per minute. Errors and refusals do not consume credit.

Is this API compatible with existing OpenAI SDKs?

Yes, it is an OpenAI-compatible API. You can use the official Python and Node.js SDKs by simply changing the base URL and API key. This ensures your existing code works with minimal changes.

Begin with free credits

Enter email and password, key displayed immediately.

Create key