인증 및 Base URL
올바른 베이스 URL과 유효한 API 키로 클라이언트 구성을 업데이트하여 API에 연결하세요. 모든 요청은 고유한 키를 사용한 표준 Authorization 헤더가 필요합니다.
Google 또는 이메일로 가입하여 즉시 키를 받으세요. 이 키는 합법적인 성인 콘텐츠 생성을 위한 uncensored 모델에 대한 액세스 권한을 부여합니다.
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"}]
}'
Chat Completions 엔드포인트
에 텍스트 프롬프트를 보내세요 chat/completions 생성된 응답을 받는 엔드포인트입니다. 이 엔드포인트는 표준 OpenAI 호환 페이로드를 허용합니다.
Specify the model ID as uncensored 성인 주제에 대한 거부 없이 모델이 응답하도록 보장합니다. API는 텍스트 입력을 처리하고 텍스트 출력을 효율적으로 반환합니다.
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);스트리밍
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)