繁中 ▾
bestuncensoredmodel.comOpenAI-compatible API,用於 Uncensored 生成

無審查 ai API 文件

使用熟悉的 OpenAI 相容 API 將我們最佳的無審查模型整合至您的應用程式。發送標準聊天完成請求,並接收無限制的文本回應,對於合法的成人內容零拒絕。

身份驗證與基礎 URL

在儀表板生成您的 API 金鑰。基礎 URL 為 https://api.bestuncensoredmodel.com/v1。將您的金鑰傳入 Authorization 每次請求的標頭。此設定適用於任何標準的 OpenAI 相容客戶端函式庫。 透過 Google 或電子郵件立即取得金鑰。

聊天完成端點

發送訊息至 /v1/chat/completions 端點。模型 ID 為 uncensored. 它接受具有 role 與 content 欄位的標準訊息結構。請求直接處理,不經過其他供應商路由。使用此進行不需要過濾的文字生成任務。

curl https://api.bestuncensoredmodel.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "explain memory allocation in C"}]
  }'

串流回應與 Token

在請求主體中將 stream: true. 您將收到用於即時 token 交付的 Server-Sent Events (SSE)。Token 使用詳情出現在串流的最後一個區塊。此方法可降低長輸出內容的感知延遲。 串流透過官方 SDK 完全支援。

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)

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.bestuncensoredmodel.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.bestuncensoredmodel.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);

檢索 your API 金鑰

註冊,複製金鑰,更新您的基礎 URL。只需這樣即可。