deepseek4api.comDocs
DeepSeek V4 API: First request in five minutes
Get started with the uncensored DeepSeek V4 API alternative in under five minutes. This guide shows you how to authenticate, send your first request, and handle streaming responses using standard OpenAI-compatible clients.
- Base URL
- https://api.deepseek4api.com/v1
- Model
- uncensored
Authentication & Base URL
Our API uses standard API key authentication. You can generate a key instantly on the Get API key page by entering your email and password. No credit card is required for the trial, which includes $0.50 in valid credit for 7 days. Once you have your key, configure your client to use our base URL: https://api.deepseek4api.com/v1.
Set the Authorization header to Bearer YOUR_API_KEY. This base URL works with any OpenAI-compatible SDK. The model identifier you must specify in your requests is uncensored. This ensures you are interacting with our open-weight model tuned for unrestricted responses, rather than any vendor-specific variant.
Basic Chat Completion
Send a standard chat completion request to generate text. The API accepts a list of messages containing role and content fields. Below is a basic cURL example demonstrating a simple text query. This works for any OpenAI-compatible client by adjusting the base URL and model ID.
curl https://api.deepseek4api.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."}]
}'Replace YOUR_API_KEY with your generated key. The response will contain a standard choices array with the generated text. Note that this endpoint supports tool/function calling, allowing you to integrate structured outputs into your applications.
Python SDK Integration
Use the official OpenAI Python SDK to interact with our API. Configure the client with our base URL and your API key. The model name is uncensored. This approach lets you keep your existing client code while switching the backend model.
from openai import OpenAI
client = OpenAI(base_url="https://api.deepseek4api.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)Ensure you have the openai package installed. The code above demonstrates a synchronous request. For asynchronous applications, you can use the AsyncOpenAI client with the same configuration. This method is ideal for backend services where you need reliable, non-streaming text generation.
Node SDK Usage
For Node.js applications, use the openai npm package. Initialize the client with the baseURL pointing to our service and provide your API key. The model identifier remains uncensored.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.deepseek4api.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 setup allows you to integrate uncensored LLM capabilities into your JavaScript or TypeScript projects. The SDK handles the JSON serialization and HTTP requests automatically. You can extend this basic setup to include tools or function calling if your application requires structured data outputs.
Streaming Responses
For real-time text generation, enable streaming in your client. Set stream: true in your request parameters. The API returns Server-Sent Events (SSE), allowing you to process tokens as they are generated. This reduces perceived latency for end-users.
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)Handle the stream events in your code to display text incrementally. Streaming works with both Python and Node SDKs. Ensure your client properly closes the stream connection when the response is complete or if an error occurs. This feature is essential for chat interfaces where immediate feedback is critical.
Limits, Errors & Context
The API enforces a 100,000 token context window for both prompt and completion combined. Request bodies must not exceed 8 MB. You are limited to 300 requests per minute per API key. If you exceed this limit, you will receive a 429 rate limit error.
Authentication errors return 401 if the key is invalid. Billing errors return 402 if your prepaid credit is exhausted. Unlike subscriptions, our pay-as-go credits never expire. Regenerate your key at any time from the dashboard, which instantly revokes the old key. This ensures secure access management without downtime.
Technical reference
If your tool speaks the OpenAI API, these are the details that matter.
| Feature | Support |
|---|---|
| API format | 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.deepseek4api.com/v1 |
| Model ID | uncensored |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Max output | 16,000 tokens max; 2,048 if max_tokens is not set |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Streaming | Supported (stream: true), usage included at the end |
| Max context | 100,000 tokens, input and output combined |
| Structured output | JSON object mode via response_format json_object |
| Parallel requests | up to 8 in parallel per key |
| Requests per minute | 300/min per key |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Max body | 8 MB request body |
| Payment | crypto: USDT on TRON or USDC on Base, $10–$500, any whole sum |
| Bonus credit | +5% from $50, +10% from $100 |
| Trial credit | $0.50 of credit valid 7 days, no card needed |
| Subscription | no monthly fee; paid credit does not expire |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Price | $0.25 per 1M input tokens · $1.00 per 1M output tokens |
| Keys | one key per account, regenerate any time (the old one stops working) |
| Content | uncensored for adults; the only hard rule: no sexual content involving minors |
| Sign-in | Google or e-mail and password |
Errors and what to do
Every error is JSON with a type you can switch on. You are never charged for an error.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or prompt + max_tokens over the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | sexual content involving minors — refused, not billed |
404 | not_found | unknown endpoint |
413 | request_too_large | request body larger than 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
Does this service replace DeepSeek V4?
No, we are an independent service offering an uncensored alternative. We do not serve the official DeepSeek V4 model from DeepSeek. Our model is an open-weight variant tuned for unrestricted responses, compatible with standard OpenAI API clients.
What happens if I exceed the 300 requests per minute limit?
You will receive a <code>429</code> Too Many Requests error. Your API key remains valid, and you can retry after the rate limit window resets. You can regenerate your key at any time if needed, which invalidates the previous key.
Is the trial credit renewable?
The $0.50 trial credit is valid for 7 days and is available once per person. It requires no credit card. To continue usage after the trial, you can purchase prepaid credits starting at $10, which never expire.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.