基礎 URL 與驗證
無審查 LLM API 位於 https://api.minimaxuncensored.com/v1. 透過在 Authorization 標頭。每個請求都需要此標頭以標識您的帳戶並追蹤 token 使用情況與您的預付餘額。
- 基礎 URL:
https://api.minimaxuncensored.com/v1 - 標頭:
Authorization: Bearer YOUR_API_KEY
支援的端點:/v1/chat/completions
我們僅支援 POST /v1/chat/completions 和 GET /v1/models. 此處無嵌入、影像或微調端點。這種簡易性確保了無審查內容生成的可預測行為,無需路由複雜性。
將您的對話歷史作為訊息的 JSON 陣列傳送。API 返回尊重您模型配置的文字補全。
模型 ID 與配置
將模型 ID 設定為 uncensored 在你的請求中。此特定的開放權重模型運行在我們的伺服器上,不會拒絕合法的成人、虛構或爭議性主題。它不是 GPT、Claude 或其他任何供應商模型。
配置類似 temperature 和 top_p 的參數 temperature 和 top_p 控制創造力。上下文視窗總計支援 100,000 個 token,包含提示和補總計。
參數:Temperature、Top-P 與 JSON 模式
使用 temperature 調整隨機性和 top_p 用於核採樣。透過設定 response_format 以 {"type": "json_object"}. 這可強制產生結構化輸出,適用於程式化使用情境。
其他支援的參數包括 stop, seed, presence_penalty,以及 frequency_penalty. 這些參數可讓您微調生成風格。
串流回應與 Token 用量
在請求主體中將 stream: true 在你的請求主體中。API 會回傳伺服器發送的事件 (SSE),其中包含部分 token。Token 使用統計數據會出現在串流的最後一個區塊。
此方法可降低長篇非審查回應的感知延遲。它非常適合需要立即傳遞文字的即時應用程式。
限制、錯誤與上下文視窗
您的限額為每分鐘 300 次請求,每個金鑰最多 8 個併發請求。最大請求主體大小為 8 MB。401 等錯誤表示金鑰無效,而 402 表示預付信用已耗盡。因信用耗盡導致的拒絕回應是免費的。
上下文視窗為 100,000 個 token。每次請求最大輸出為 16,000 個 token。超出這些限制會導致 429 速率限制錯誤。
cURL
curl https://api.minimaxuncensored.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List the main differences between python 3 and python 2"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.minimaxuncensored.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.minimaxuncensored.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)