繁中 ▾

API 文件

使用標準的 OpenAI 相容端點將我們的無審查 LLM 整合到您的應用程式中。您將獲得原始、無限制的輸出,只需發送文字並獲取文字,且無訂閱綁定。

建立金鑰

驗證與 base URL 設定

開始透過儀表板的 Google 或電子郵件取得您的 API 金鑰。使用基本 URL https://api.deepseekunrestricted.com/v1 適用於所有請求。將金鑰傳送至 Authorization header 作為 bearer token。

curl https://api.deepseekunrestricted.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "what is the current version of the linux kernel"}]
  }'

您的金鑰立即生效。如有需要,您可以隨時從控制台旋轉金鑰。

首次使用 Python 的請求

使用您的基礎 URL 和金鑰初始化客戶端。將模型 ID 設定為 uncensored. 該模型針對合法成人用途無內容審查地回答。

from openai import OpenAI

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

回應包含生成文字。您可以調整溫度等參數以控制創造力。錯誤是免費的,因此重試邏輯是安全的。

Node.js 集成

安裝官方 OpenAI SDK 或直接使用 fetch。將基礎 URL 設定為指向我們的端點。傳遞模型 ID uncensored 請求主體中。

import OpenAI from "openai";

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

處理回應串流或解析 JSON 物件。此方法適用於任何 OpenAI 相容的客戶端程式庫。您只需為實際使用的 token 付費。

串流回應

在請求主體中將 stream: true. API 返回伺服器發送的事件 (SSE)。每個區塊包含部分文字和 token 使用數據。

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)

匯總這些片段以重建完整回應。這可降低大輸出的感知延遲。Token 計數每個片段都準確。

JSON 模式與工具

使用 response_format: {"type": "json_object"} 用於嚴格的 JSON 輸出。使用 tools 參數。模型支援 tool_choice 用於控制。

這可確保應用程式邏輯的可靠解析。使用 temperature 和 top_p 調整隨機性。停止序列有助於控制輸出長度。

速率限制與錯誤

您獲得每分鐘 300 個請求和每個金鑰 8 個並發請求。401 錯誤表示您的金鑰無效。402 錯誤表示信用額度不足。

curl https://api.deepseekunrestricted.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "what is the current version of the linux kernel"}]
  }'

429 錯誤表示已超過速率限制。主體大小超過 8 MB 的請求將失敗。額度永不過期。拒絕免費。如有帳單問題,請使用支援頁面。

常見問題

無審查 deepseek API 請求的上下文視窗為何?

提示與補全的總上下文視窗為 100,000 tokens。每次請求的最大輸出為 16,000 tokens。若 max_tokens 未定義,請設定為 2,048 tokens。

無審查模型會過濾 NSFW 內容嗎?

該模型不會拒絕合法的成人、虛構或爭議性話題。它僅封鎖涉及未成年人的性內容。此原則適用於所有請求,無論信用餘額為何。

deepseek 非限制 API 的計費方式為何?

餘額根據實際 Token 使用量計費。錯誤和拒絕的情況免費。您僅能透過加密貨幣充值。餘額永不過期,且較大金額可獲得贈送餘額。

立即取得金鑰

註冊、複製 API 權杖,並更新基礎網址。這就是全部。

建立金鑰