Unsensored AI API 文檔
幾分鐘內即可使用標準的 OpenAI SDK 整合我們的無審查 LLM API。輸入文字,取得原始文字輸出,無訂閱綁定。
驗證與 base URLs
使用官方 OpenAI SDK 並搭配自訂 base URL。您的 API 金鑰將用於驗證每個請求。
基礎 URL: https://api.unsensoredai.com/v1
模型 ID: uncensored
curl https://api.unsensoredai.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "what is the capital of france"}]
}'
聊天完成端點
透過 POST /v1/chat/completions. 模型返回文本,不過濾內容。
上下文窗口:總計 100,000 tokens。最大輸出:16,000 tokens。
from openai import OpenAI
client = OpenAI(base_url="https://api.unsensoredai.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)
串流回應
啟用串流以即時交付 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)
函式呼叫與工具
支援工具定義與自動函式呼叫。在請求主體中定義工具。
該模型根據上下文選擇工具。
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unsensoredai.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 模式與參數
強制結構化輸出,搭配 response_format: {"type": "json_object"}. 控制溫度、top_p 和停止序列。
設定 seed 以獲得可重現的結果。
速率限制與配額
每金鑰每分鐘 300 次請求。允許 8 個並發請求。
8 MB request body limit. Errors are free. Credits expire only if unpaid.
常見問題
有與 OpenAI SDK 相容的無審查 AI 嗎?
是的。我們的 API 完全與 OpenAI 相容。使用標準 SDK 並搭配我們的基礎 URL 即可。
unsensored LLM 使用的計費方式為何?
僅限預付額度。每 1M 輸入 token 收費 $0.15,每 1M 輸出 token 收費 $0.50。無每月費用。
如果我觸及速率限制會發生什麼事?
您收到 429 錯誤。請等待幾秒後重試。限制是針對每支 API 金鑰的。
產生您的 API 金鑰
註冊,複製你的金鑰,並更新基礎 URL。設定只需幾秒。