DeepSeek API URL: Base URL and Endpoints for Our API
The deepseek api_url you need here is https://api.deepseeknsfw.top/v1, and requests go to /chat/completions underneath it. This page lists every path, header and setting, and the mistakes that produce 404 and 401 errors.
Updated

Key points
- Base URL: https://api.deepseeknsfw.top/v1, which already includes /v1.
- Two methods exist: POST /v1/chat/completions and GET /v1/models.
- Send the key as Authorization: Bearer, with model uncensored.
- Most 404 errors come from a doubled /v1 or a wrong path.
The values to copy
| Setting | Value |
|---|---|
| Base URL | https://api.deepseeknsfw.top/v1 |
| Chat endpoint | https://api.deepseeknsfw.top/v1/chat/completions |
| Model list | https://api.deepseeknsfw.top/v1/models |
| Auth header | Authorization: Bearer YOUR_KEY |
| Model ID | uncensored |
The service is independent and is not operated by DeepSeek, so the host name differs from any vendor's own address. What stays the same is the shape of the API: it follows the OpenAI Chat Completions format, which is why clients built for that format work after a URL change.
What the base URL means
An OpenAI-style SDK builds each request by appending a path to the base URL you give it. Give it https://api.deepseeknsfw.top/v1 and the chat call goes to https://api.deepseeknsfw.top/v1/chat/completions. The base URL ends with /v1 and has no trailing slash and no endpoint name.
That is why a field called "API URL" in some apps is confusing. Some tools want the base only (.../v1). Others want the complete endpoint (.../v1/chat/completions). Read the placeholder text or the tool's docs. If it shows a sample URL ending in /v1, use the base form. If the sample ends in /chat/completions, paste the full path.
The two endpoints
POST /v1/chat/completions
This is the main method. It takes model, messages and optional parameters such as temperature, top_p, stop, seed, penalties, stream, tools and response_format. The body can be up to 8 MB, and prompt plus completion together can use 100,000 tokens.
GET /v1/models
This returns the model list. Use it as a connectivity test, because it needs no body and it proves both the URL and the key.
curl https://api.deepseeknsfw.top/v1/models \
-H "Authorization: Bearer $API_KEY"
Other paths from the wider OpenAI API, such as image, audio or embeddings routes, do not exist here. The service is text only. A tool that calls /embeddings will fail, and that is expected.
Reading the response
A successful chat call returns JSON in the OpenAI shape. The text is at choices[0].message.content, the reason generation stopped is in finish_reason, and the token counts are in usage as prompt_tokens and completion_tokens. Multiply those counts by the per-million prices ($0.15 input, $0.50 output) and you have the exact cost of the call.
The headers matter as much as the body. X-Balance-USD shows what is left of your prepaid credit. X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency tell you which limits apply to the key you used, which is a quick way to see if the key is a trial key (60 requests per minute, 2 at once) or a full key (300 and 8).
If you want tokens as they are generated, add "stream": true to the request body. The URL stays the same; only the way you read the response changes, and the final chunk includes usage.
Configure it in code
from openai import OpenAI
client = OpenAI(
base_url="https://api.deepseeknsfw.top/v1",
api_key="YOUR_KEY",
)
print([m.id for m in client.models.list().data])
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.deepseeknsfw.top/v1",
apiKey: process.env.API_KEY,
});
const models = await client.models.list();
console.log(models.data.map((m) => m.id));
Both snippets should print a list containing uncensored. Many SDKs also read environment variables, which keeps the URL out of your source:
export OPENAI_BASE_URL="https://api.deepseeknsfw.top/v1"
export OPENAI_API_KEY="YOUR_KEY"
Recent official OpenAI SDKs pick up those two names on their own. If your library does not, pass the values explicitly as shown above.
Pointing a chat front end at the URL
Chat front ends that accept a custom OpenAI-compatible endpoint, such as SillyTavern, need the same three values: the URL, the key and a model name. In SillyTavern, for example, you choose an OpenAI-compatible (custom) source, paste the base URL, add the key and type uncensored as the model. Menu labels vary between versions, so look for fields named like "custom endpoint" or "API URL".
After saving, send a short test message. If the app has a "connect" or "test" button that lists models, a successful call to /models is what you are seeing behind it.
Test the connection in three steps
When a client says "cannot connect", test from the outside in, so you know which layer is at fault.
- Reach the host. Run
curl -I https://api.deepseeknsfw.top/v1/models. Any HTTP status, even 401, proves that DNS, TLS and routing work. - Check the key. Add the Authorization header. A JSON model list means the key is valid. A 401 means the key or header is wrong.
- Check the chat path. Send a one-line chat request with
"model": "uncensored"and a shortmax_tokens. A normal reply means the URL, key and body are all fine, and any remaining problem is inside your app.
Keep the failing step in mind when you ask for help. "401 on models" and "404 on chat" point to very different fixes, and the X-Request-Id response header lets support find the request.
Keeping the URL out of your code
Hard-coded endpoints become a chore when you add a staging copy or rotate keys. Put the base URL and key in configuration. A .env file loaded by your framework works for local work. In production, use the secret store of your host. Never place the key in a mobile app or in browser JavaScript, since anyone can read it there. Instead, send requests from your own server and let the front end talk to that.
If you run the tool inside Docker, remember that environment variables are set for the container, not for your shell. A missing variable shows up as a call to the SDK's default address, which is a common reason a "working" script suddenly fails in a container. Printing the configured base URL at start-up takes one line and saves an hour of guessing.
Finally, remember the body limit of 8 MB per request. A prompt that embeds large files will hit it long before it hits the 100,000-token context window.
Errors that point to a bad URL
| Symptom | Likely cause | Fix |
|---|---|---|
| 404 Not Found | Doubled path such as /v1/v1/chat/completions, or a missing /v1 | Use the base URL exactly as listed |
| 404 on chat only | The tool wanted the full endpoint and got the base | Append /chat/completions |
| 401 Unauthorized | Missing or wrong Bearer key, extra spaces or quotes | Re-copy the key, check the header |
| Connection or SSL error | Typo in the host, or http instead of https | Use https with the exact host |
| 429 | A rate or concurrency limit, not a URL problem | Back off; see the limits below |
Limits are 8 concurrent requests and 300 per minute on a full key, and 2 and 60 on a trial key. The 429 body carries the code rate_limited or concurrency, and temporary overload adds a Retry-After: 5 header. Responses include X-Request-Id and X-Balance-USD, which help when you debug.
Next steps
Once the URL works, get a key from the API key page, where new users can claim $0.50 of trial credit with no payment method. Read the docs for request details and the pricing page for the rates: $0.15 per 1M input tokens and $0.50 per 1M output tokens, paid from prepaid credit in crypto (USDT on TRC20 or USDC on Base). If you want a walkthrough with code for each step, see how access and keys work.
More guides
Questions and answers
What is the base URL?
https://api.deepseeknsfw.top/v1. Append /chat/completions for chat requests and /models for the model list.
Should the URL include /chat/completions?
Only if your tool asks for the full endpoint. SDKs and most apps want the base URL and add the path themselves.
Does this URL belong to the official DeepSeek API?
No. It is an independent hosted service with one open-weight model, reachable through an OpenAI-compatible interface.
Are there endpoints for images or embeddings?
No. Only POST /v1/chat/completions and GET /v1/models exist, and the service handles text only.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.