無審查 GPT API 文檔
透過發送簡單請求,開始使用無審查 GPT API。本指南涵蓋身份驗證、SDK 整合、串流處理以及錯誤處理,以便立即使用。
基礎 URL 與驗證
使用官方基礎 URL 和您的 API 金鑰進行連接。端點為 https://api.uncencoredgpt.com/v1。將您的金鑰傳入 Authorization 標頭。此設定與任何 OpenAI 相容的用戶端搭配使用。
- 主要格式:
Bearer sk-... - 無訂閱費用。
curl https://api.uncencoredgpt.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List the top five open source models."}]
}'
首次聊天請求
發送提示並獲取回應。使用模型 ID uncensored. API 接受標準的聊天完成參數。回應僅為文字。
from openai import OpenAI
client = OpenAI(base_url="https://api.uncencoredgpt.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 集成
輕鬆整合 JavaScript 專案。設定基礎 URL 和模型 ID。SDK 會自動處理序列化。
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.uncencoredgpt.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);
串流回應
接收即時生成的 token。啟用串流請設定 stream: true. 讀取區塊以顯示部分輸出。這顯著降低了感知延遲。
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)
參數:溫度與 Top-P
使用以下參數控制隨機性 temperature 和 top_p. 較高的值會增加創意。較低的值會提高確定性。使用 seed 用於獲得可重現的輸出。調整這些參數以符合您的使用情境。
限制、錯誤與上下文
注意速率限制和上下文視窗。上下文視窗總計為 100,000 個 token。錯誤包含無效金鑰的 401 和速率限制的 429。拒絕回應是免費的。
常見問題
這是無審查的 GPT 模型嗎?
不,它是一個無審查的開權重模型。它不是 GPT、Claude 或任何其他廠商的模型。它接受相同的 API 格式。
我如何付費?
使用加密貨幣付款。僅限 USDT (TRC20) 或 USDC (Base)。最低充值金額為 $20。信用額度永不過期。
什麼是上下文窗口?
上下文視窗為 100,000 個 token。這包括提示和補全。每次請求的最大輸出為 16,000 個 token。
取得您的 API 金鑰
註冊、複製金鑰、更新基礎 URL。這就是所需的全部設定。