Xác thực và Base URL
Kết nối với API bằng cách cập nhật cấu hình máy khách của bạn với URL cơ sở chính xác và khóa API hợp lệ. Mọi yêu cầu đều yêu cầu tiêu đề Authorization tiêu chuẩn bằng khóa độc nhất của bạn.
Đăng ký bằng Google hoặc email để nhận khóa ngay lập tức. Khóa cấp quyền truy cập vào mô hình không kiểm duyệt để tạo nội dung người lớn hợp pháp.
curl https://api.nsfwminimax.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Set my user role to moderator in the config file"}]
}'
Điểm cuối Chat Completions
Gửi các prompt văn bản đến chat/completions endpoint để nhận phản hồi đã tạo. Endpoint này chấp nhận các tải trọng tương thích với OpenAI tiêu chuẩn.
Chỉ định ID mô hình là uncensored để đảm bảo mô hình trả lời mà không có từ chối cho các chủ đề người lớn. API xử lý đầu vào văn bản và trả về đầu ra văn bản một cách hiệu quả.
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwminimax.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.nsfwminimax.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);Phát trực tiếp
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)