基礎 URL 與身份驗證
API 託管於 https://api.unfilteredvideo.cc/v1。它遵循標準的 OpenAI 聊天補全介面。您透過在 Authorization 標頭中提供您的 API 金鑰作為 Bearer token 來進行驗證。您的金鑰在透過 Google 或電子郵件註冊後立即產生。請確保傳遞精確的金鑰字串;輸入錯誤將導致 401 錯誤。
發送您的第一個請求
對 /v1/chat/completions 發出 POST 請求,並附上您的模型 ID uncensored。該模型為合法成人內容生成文本且無拒絕。您可以指定 temperature 等參數來控制創造力。此端點處理您影片資產的提示詞撰寫、腳本生成和元資料擷取。
curl https://api.unfilteredvideo.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
Python SDK 整合
使用官方的 OpenAI Python 客戶端。將 Base URL 設為我們的端點,並提供您的 API 金鑰。這使您能夠使用熟悉的 chat.completions.create() 方法。該客戶端處理 JSON 序列化和 HTTP 請求。將模型 ID 設定為 uncensored,以確保您使用的是我們特定的無審查 LLM。
from openai import OpenAI
client = OpenAI(base_url="https://api.unfilteredvideo.cc/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 用法
使用我們的 Base URL 初始化 OpenAI Node.js 客戶端。傳遞您的 API 金鑰進行驗證。使用 chat.completions.create 方法搭配 uncensored 模型。此方法非常適合伺服器端腳本生成或影片管線中的後處理任務。確保您的 Node 環境支援所需的 fetch API。
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unfilteredvideo.cc/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 會傳回 Server-Sent Events (SSE)。您會收到生成中的文字區塊。最後一個區塊包含 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)
速率限制與錯誤
每個 API 金鑰每分鐘限用 300 次請求。每個金鑰的並行請求上限為 8。若超過此限制,您將收到 429 錯誤。使用 401 錯誤表示金鑰無效。402 錯誤表示您的預付額度已耗盡。上下文視窗總計為 100,000 tokens,回應可延伸至視窗結尾。錯誤與拒絕生成不會消耗額度。