- GPT NoFilter
- 無審查 API 快速入門指南
無審查 API 快速入門指南
將您現有的客戶端程式碼連接至 nofilter GPT API。本指南涵蓋了驗證、端點以及用於無限制內容生成的串流功能。
基礎 URL 與驗證
API 端點位於 https://api.gptnofilter.com/v1. 將客戶端的基礎 URL 更新為此地址。認證使用標準 API 密鑰,通過 Authorization header 作為 Bearer token。每個帳戶僅限一個金鑰,產生新金鑰時會立即取代舊金鑰。
首次請求
向以下網址發送 POST 請求 /v1/chat/completions. 模型 ID 為 uncensored. 此端點接受文字輸入並返回文字輸出。它不支援圖片、音訊或影片生成。
curl https://api.gptnofilter.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "What are the API limits for this model"}]
}'
請求主體必須包含模型 ID 和您的消息內容。系統處理提示並返回補全 token。
Python SDK 集成
使用官方 OpenAI Python SDK。將其指向我們的基礎 URL 並提供您的 API 金鑰。程式碼與標準 OpenAI 用法完全相同,除了端點外。
from openai import OpenAI
client = OpenAI(base_url="https://api.gptnofilter.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)
此設定允許您使用熟悉的方法,例如 client.chat.completions.create. 回應結構符合 OpenAI 標準格式。
Node SDK 整合
安裝 OpenAI Node.js 套件。配置 apiKey 和 baseURL 屬性。這確保與現有腳本相容。
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.gptnofilter.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);
呼叫補全端點並使用 uncensored 模型。SDK 自動處理序列化與標頭注入。
串流與 JSON 模式
在請求主體中將 stream 設為 true。您會收到伺服器發送事件(SSE)區塊。最後一個區塊包含總權杖使用量。您也可以使用 response_format: {type: "json_object"}. 這有助於結構化資料生成。
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)
透過 tools 參數。模型在執行期間會遵循指定的工具定義。
速率限制與上下文視窗
每組金鑰允許每分鐘 300 次請求。並行請求上限為 8 次。請求主體不得超過 8 MB。上下文視窗總共支援 100,000 個 token。這包含提示詞與補全內容。每次請求的最大輸出為 16,000 個 token。如果您未設定 max_tokens, 限制預設為 2,048 個 token。錯誤和拒絕不消耗信用額度。401 錯誤表示您的金鑰無效。402 錯誤表示信用額度不足。429 錯誤表示您達到了速率限制。
常見問題
這與 ChatGPT 相同嗎?
否。我們託管自己的無審查大型語言模型。它不是 GPT、Claude 或其他供應商's 模型。這是一個針對無限制回應進行微調的開權重模型。
如果我的信用額度耗盡會怎樣?
請求將回傳 402 錯誤。您可以使用 USDT (TRC20) 或 USDC (Base) 充值。信用額度永不過期。較大金額的充值適用信用額度獎勵。
您使用我的資料進行訓練嗎?
否。提示詞不會用於訓練。我們僅需您的電子郵件來建立帳戶,無需提供手機號碼即可註冊。
保護您的金鑰
註冊、取得金鑰、更新端點。設定極簡。
取得 API 金鑰