基础 URL 和认证
无审查 LLM API 位于 https://api.minimaxuncensored.com/v1. 通过在 中传递 API 密钥进行身份验证 Authorization 。每个请求都需要此 header 来标识您的账户并跟踪 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 控制创造性。上下文窗口总共支持 100,000 个 token,用于提示和补全的组合。
参数:温度、Top-P 和 JSON 模式
使用 temperature 调整随机性和 top_p 用于核采样。通过设置 response_format 到 {"type": "json_object"}. 这为编程用例强制实现结构化输出。
其他支持的参数包括 stop, seed, presence_penalty,以及 frequency_penalty. 这些参数允许对生成风格进行微调。
流式响应与 Token 用量
通过将 stream: true 在您的请求正文中。API 返回包含部分 Token 的服务器发送事件 (SSE)。Token 使用统计信息出现在流的最后一个数据块中。
此方法降低了长 uncensored 响应的感知延迟。它非常适合需要即时文本交付的实时应用。
限制、错误和上下文窗口
您的请求频率限制为每分钟 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)