否 過濾器 GPT API 文檔
在幾分鐘內將您的程式碼連接到我們的無審查 API。插入基礎 URL,設定金鑰,即可獲得沒有企業審查的原始文字回應。
基礎 URL 與驗證
所有請求的基礎 URL 為 https://api.gptfilterno.com/v1. 您需要一個有效的 API 金鑰在 Authorization 標頭. 使用 Bearer sk-... 格式。金鑰在每個帳戶中僅限一次使用;新的金鑰會取代舊的金鑰。
首次請求
向以下網址發送 POST 請求 /v1/chat/completions 使用模型 uncensored. 模型針對合法內容直接回答,不會拒絕。
輸入文本,輸出文本。在構建應用程序之前,可用於測試連接性。
如果進行串流,回應會在最後一個區塊中包含 token 使用情況。
Python SDK 集成
使用官方 openai Python 函式庫。將基礎 URL 更改為指向我們的端點。在環境或客戶端設定中設定 API 金鑰。
呼叫 chat.completions.create() 使用模型 uncensored。視需要傳入 temperature、top_p 和其他參數。
此方法適用於任何需要非審查文字生成的 Python 應用程式。
Node SDK 整合
安裝 openai Node 套件。使用我們的基礎 URL 和 API 金鑰配置客戶端。
呼叫 chat.completions.create() 使用模型 uncensored. 回應是標準的 OpenAI 相容物件。
用於需要不受限制 LLM 輸出的 Node.js 伺服器或腳本。
串流回應
在請求主體中將 stream: true. API 返回伺服器發送的事件 (SSE)。
每個區塊包含部分文字和 token 用量數據。隨著區塊到達即時處理,以實現即時輸出。
這可降低長回應時的感知延遲。
Limits and Errors
上下文窗口總計為 100,000 token。每次請求的最大輸出為 16,000 token。
速率限制為每分鐘 300 次請求。併發請求上限為 8 個。
錯誤包含 401(無效金鑰)、402(餘額不足)和 429(速率限制)。錯誤免費。
cURL
curl https://api.gptfilterno.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list the core features of the current release"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.gptfilterno.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
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.gptfilterno.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);串流
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)獲取 your API key in seconds
註冊,複製你的金鑰,更新端點。完成。