EN ▾
Get API key

Quickstart for DeepSeek Coder users

Integrate our uncensored LLM API in minutes by swapping your base URL and API key. This guide covers the essential endpoints, streaming, and structured output modes using standard OpenAI-compatible SDKs.

Authentication & Base URL

To use the deepseek coder api, you need a valid API key and the correct base URL. You can generate a key instantly on the Get API key page by signing in with Google or using an email and password. Once created, the key is displayed immediately and must be sent in the Authorization header as a Bearer token.

The base URL for all requests is https://api.deepseekcoderapi.com/v1. This endpoint is fully compatible with the official OpenAI SDKs and any OpenAI-compatible client. By simply updating the base_url and providing your API key, you can route your existing code to our uncensored model without changing the request structure.

Basic Chat Completion Request

Start by sending a simple text-in, text-out request to the /v1/chat/completions endpoint. This is the standard way to interact with the model for code generation, reasoning, or general Q&A tasks. You must specify the model ID as uncensored to ensure you are using the correct open-weight model tuned for fewer content refusals.

Here is a minimal example using curl to send a prompt and receive a completion:

curl https://api.deepseekcoderapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'

This request demonstrates the core functionality of the API. The model will process your input and return a text response. Ensure your payload includes the necessary messages array with a user role and your specific query.

Python SDK Integration

For Python developers, the official openai package works seamlessly with our API. You only need to configure the client to point to our base URL and provide your API key. This allows you to use familiar methods like client.chat.completions.create() to integrate the uncensored model into your applications.

Use the following snippet to initialize the client and make a request:

from openai import OpenAI

client = OpenAI(base_url="https://api.deepseekcoderapi.com/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)

This approach ensures that your existing Python logic remains intact while leveraging our specific model capabilities. Remember that the model ID must be set to uncensored to access the correct version of the open-weight model hosted on our servers.

Node SDK Integration

JavaScript and TypeScript developers can use the @anthropic-ai/anthropic-node or the official openai npm package with our API. By overriding the baseURL property, you can direct requests to our endpoint while maintaining standard SDK behavior. This makes it easy to drop our API into Node.js projects that already use OpenAI-compatible clients.

Here is how you can configure the client in Node.js:

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.deepseekcoderapi.com/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);

This configuration allows you to send chat completions using the same structure as the OpenAI API. The response will contain the model's output, which you can then process or display in your application.

Enabling Streaming Responses

For real-time interactions, enable streaming by setting stream: true in your request. This allows you to receive the model's response token-by-token, which is ideal for chat interfaces or applications that benefit from immediate feedback. The API uses Server-Sent Events (SSE) to deliver these tokens sequentially.

Here is an example of how to handle streaming responses:

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)

Streaming is particularly useful for long completions, as it provides a smoother user experience. Note that token usage information is included in the final chunk of the stream, allowing you to track consumption accurately.

Using Function Calling (Tools)

The API supports function calling, allowing the model to return structured data that your application can execute. You can define tools in your request and let the model decide when to call them. This is useful for tasks like extracting data, triggering actions, or generating code snippets based on user input.

Configure your tools and request a completion to see the model's response:

This feature enables complex workflows where the model acts as an intelligent agent. Ensure that your tool definitions are clear and that the model has enough context to make accurate decisions about when to invoke each tool.

Forcing JSON Output Format

To ensure consistent parsing in your application, you can force the model to output JSON by setting response_format to {"type": "json_object"}. This is particularly useful when you need structured data for further processing or storage. The model will attempt to format its entire response as valid JSON.

Use the following request structure to enforce JSON output:

This mode reduces the need for post-processing to extract valid data. It is ideal for APIs that consume the model's output directly, ensuring that the response is always in a predictable format.

Understanding Context Windows

The model supports a context window of 100,000 tokens, which includes both the prompt and the completion. This allows for extensive conversations or large code blocks to be processed in a single request. However, keep in mind that there is no separate output cap, and if max_tokens is not specified the response can run to the end of the window.

When designing your application, consider how the context window affects your token budget. Long conversations may require truncating older messages to stay within the limit. Efficient management of the context window ensures optimal performance and cost-effectiveness.

Capabilities and limits

Everything the endpoint can and cannot do, in one place — check it before you top up.

ParameterDetails
CompatibilityOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
MethodsPOST /v1/chat/completions · GET /v1/models
AuthenticationBearer token in the Authorization header
Modeluncensored
Base URLhttps://api.deepseekcoderapi.com/v1
Max outputup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Context window100,000 tokens, input and output combined
Structured outputJSON object mode via response_format json_object
Function callingYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
StreamingSupported (stream: true), usage included at the end
Request size8 MB request body
Rate limit300/min per key
Parallel requests8 requests at the same time per key
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
How you payprepaid credit, charged by real token usage; errors and refusals are free
Token pricesinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Free trial$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Volume bonus+5% from $50, +10% from $100, +15% from $200
Credit expiryno monthly fee; paid credit does not expire
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Contentuncensored for adults; the only hard rule: no sexual content involving minors
Sign-insign in with Google or with e-mail + password
Keysone active key per account; a new key replaces the old one

When a request fails

Every error is JSON with a type you can switch on. You are never charged for an error.

StatusTypeReason
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundunknown endpoint
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busymodel busy — retry in a few seconds

Questions and answers

What happens if I send an invalid API key?

The API will return a 401 Unauthorized error. Ensure that your key is correctly copied from the dashboard and that you are using the correct base URL. Each account is limited to one active key at a time.

Why do I get a 402 error?

A 402 error indicates that your prepaid credit has been exhausted. You can top up your account by crypto (USDT on TRC20, USDC on Base) to continue using the API. Errors and refusals do not consume your credit.

What are the rate limits for this API?

You are limited to 300 requests per minute and 8 concurrent requests per key. If you exceed these limits, the API will return a 429 Too Many Requests error. Ensure your application handles retries appropriately.

Your key is one form away

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

Get API key