繁中 ▾
取得 API 金鑰

API 文件

使用標準 OpenAI SDK 將您的應用程式連接至無審查 LLM 聊天 API。本指南涵蓋無審查 AI 模型的驗證、請求、串流與計費。

基礎 URLhttps://api.uncensoredllmchat.com/v1
模型uncensored

驗證

在 Authorization 標頭. 我們支援透過 Google 或電子郵件登入來即時產生金鑰。

包含標頭 Authorization: Bearer YOUR_API_KEY 每次請求中。uncensored LLM 聊天 API 的基礎 URL 為 https://api.uncensoredllmchat.com/v1.

首次請求

向以下網址發送 POST 請求 /v1/chat/completions 使用模型 ID uncensored. 模型針對合法的成人內容回答,不會拒絕內容。

設定 system prompt 以定義行為。uncensored AI 模型支援 100,000 token 的上下文視窗。

curl https://api.uncensoredllmchat.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?"}]
  }'

Python SDK 集成

安裝 OpenAI Python 套件並設定基礎 URL。這可確保與 uncensored LLM 聊天端點的相容性。

傳遞您的 API 金鑰並將模型設定為 uncensored. SDK 自動處理 tokenization 與回應解析。

from openai import OpenAI

client = OpenAI(base_url="https://api.uncensoredllmchat.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 SDK 設置

使用您的自訂基礎 URL 初始化 OpenAI 客戶端。這允許 Node.js 應用程式無縫使用 uncensored AI API。

呼叫 chat.completions.create 與 uncensored 模型 ID。線上無審查 LLM 的體驗與標準 OpenAI 行為一致。

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.uncensoredllmchat.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: true. API 透過伺服器發送事件(SSE)回傳 token。

解析串流以即時顯示 token。最後一個區塊包含用於帳單的總 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)

Limits and Errors

若金鑰無效,預期 401 錯誤。402 錯誤表示您需要透過加密貨幣(USDT/USDC)充值。

429 錯誤表示您已超過每分鐘 300 次請求的限制。上下文窗口總共為 100,000 個 token。

常見問題

uncensored LLM 聊天 API 為何?

這是一款託管的 OpenAI 相容 API,提供單一無審查的大型語言模型。它支援為合法成人用途生成無審查的文字。

我如何為無審查 AI API 付款?

您以預付信用額度付款,透過加密貨幣(TRC20 上的 USDT 或 Base 上的 USDC)充值。沒有隱藏的訂閱費用,且信用額度永不過期。

什麼是上下文窗口?

提示與補全的上下文視窗總計為 100,000 tokens。每次請求的最大輸出為 16,000 tokens。

取得您的 API 金鑰

註冊、複製金鑰,並更新基礎網址。完成。

取得 API 金鑰