前提条件:SDK 与密钥
只需使用电子邮件或 Google 登录即可创建账户。此密钥用于对无审查 AI 聊天机器人端点的每次请求进行身份验证。您可以随时生成新密钥,旧密钥将随之失效。请妥善保管密钥,因为它提供对您预付费额度的完全访问权限。
基础 URL 配置
配置你的客户端指向 HTTPS://api.unfilteredchatbotapi.com/v1。此基础 URL 适用于任何标准的 OpenAI 兼容 SDK。你还必须在 Authorization 头中设置 API 密钥。系统期望使用 Bearer 令牌格式进行身份验证。此单一端点提供无审查模型,无需路由到其他供应商。你无需更改代码中的模型名称;它是固定的。
发送您的第一个请求
向 /v1/chat/completions 发送 POST 请求并附带您的消息。模型 ID 始终为 "uncensored"。在 messages 数组中以 role 和 content 字段发送您的内容。API 将返回文本响应,且不会对合法成人主题进行标准的安全拒绝。使用此简单结构来验证连通性和响应质量。确保您的负载不超过 8 MB。处理过程中的错误不会消耗您的积分。
cURL
curl https://api.unfilteredchatbotapi.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
from openai import OpenAI
client = OpenAI(base_url="https://api.unfilteredchatbotapi.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.unfilteredchatbotapi.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)