Switch your client in three lines
Get started with the DeepSeek Coder API in under five minutes using standard OpenAI-compatible clients. This quickstart guide covers authentication, basic requests, and streaming for immediate integration.
Base URL and Authentication
To begin, you need an API key. Sign up at the Get API key page using your Google account or email. Your key is displayed immediately and is required for all requests. Unlike many providers, we do not require a phone number or credit card for the initial setup.
All requests are sent to our dedicated base URL. You do not need to modify the endpoint path, only the base URL and your authentication header. This ensures compatibility with any client that supports the OpenAI format. Keep your key secure, as it is the sole credential for your account.
We prioritize privacy: prompts are not used for training, and we only store the email address associated with your account. For detailed pricing and top-up options, refer to the pricing page.
First Request
The fastest way to verify your setup is a simple cURL request. This confirms that your authentication is correct and the model is responding. The endpoint accepts standard chat completion parameters.
Replace YOUR_API_KEY with your actual key. The model identifier is uncensored. This model is open-weight and tuned to answer without content refusals for lawful adult content, though it blocks sexual content involving minors.
If the request succeeds, you will receive a JSON response containing the generated text. If you receive a 401 error, your key is invalid. If you receive a 402 error, your account balance is insufficient.
Python SDK Integration
For Python developers, the official OpenAI SDK works with zero code changes other than updating the base URL and API key. This allows you to use familiar methods like chat.completions.create().
Install the SDK using pip install openai. Then configure the client to point to our base URL. This approach lets you leverage existing libraries and abstractions built for OpenAI-compatible endpoints.
The model uncensored supports standard parameters like temperature and top_p. Adjust these to control creativity and determinism. For production use, consider implementing retries for transient network errors.
Node.js SDK Usage
Node.js developers can also use the official OpenAI package. Similar to Python, you only need to override the base URL and API key in the client configuration.
This method is ideal for server-side applications or backend services that already use OpenAI clients. It ensures consistency if you plan to switch between different OpenAI-compatible providers later.
Remember that our API is text-only. There are no embeddings, image, or audio generation endpoints. All requests are processed as chat completions. Use this setup for standard text generation tasks, coding assistance, or data extraction.
Streaming Responses
For real-time user experiences, enable streaming. This sends the response token-by-token as it is generated, reducing perceived latency for the end user. Streaming is supported via Server-Sent Events (SSE).
When using streaming, the token usage statistics are included in the last chunk of the response. This allows you to accurately track costs and token consumption in real-time.
Streaming is particularly useful for long-form content generation or interactive applications where immediate feedback is preferred over waiting for the full completion. Ensure your client handles partial responses gracefully.
Rate Limits, Errors, and Context
Our API enforces strict limits to ensure stability. You are allowed 300 requests per minute per key and 8 concurrent requests at the same time. The maximum request body size is 8 MB.
Common errors include 401 (invalid key), 402 (insufficient credits), and 429 (rate limit exceeded). If you hit the rate limit, wait before retrying. Credits never expire, so you can top up at your convenience.
The context window is 100,000 tokens total (prompt + completion). There is no separate output cap, and if max_tokens is not set, the response can run to the end of the window. Function calling and JSON mode are supported within these constraints. For more details on limits, see the pricing page.
cURL
curl https://api.deepseekcoderapi.top/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."}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.deepseekcoderapi.top/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)Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.deepseekcoderapi.top/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);Streaming
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)Under the hood: specs
One table with every limit, feature and price that applies to your key.
| Spec | Value |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| API key | Bearer token in the Authorization header |
| Base URL | https://api.deepseekcoderapi.top/v1 |
| Model ID | uncensored |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Structured output | JSON object mode via response_format json_object |
| SSE streaming | Supported (stream: true), usage included at the end |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Function calling | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Context window | 100,000 tokens, input and output combined |
| Completion length | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Parallel requests | up to 8 in parallel per key |
| Max body | up to 8 MB per request |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Requests per minute | 300 requests per minute per key |
| 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 |
| Bonus credit | +5% on $50+, +10% on $100+, +15% on $200+ |
| Credit expiry | paid credit never expires, no subscription |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Keys | one key per account, regenerate any time (the old one stops working) |
| Account | sign in with Google or with e-mail + password |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
Error codes
Every error is JSON with a type you can switch on. You are never charged for an error.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | sexual content involving minors — refused, not billed |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
What is the context window size?
The total context window is 100,000 tokens, combining both the prompt and the completion. There is no separate output cap per single request. If you do not specify max_tokens, the response can run to the end of the window.
How do I handle errors?
Common errors include 401 (invalid key), 402 (no credit), and 429 (rate limit). For 402, top up your crypto credit. For 429, wait before retrying as you have hit the 300 requests per minute limit. Refunds are not issued for credits, but double charges can be fixed via Support.
Can I use this with the official OpenAI SDK?
Yes. The API is fully OpenAI-compatible. You only need to change the base URL to https://api.deepseekcoderapi.top/v1 and update your API key. No other code changes are required for standard chat completions.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.