Autentikasi dan URL Dasar
Terhubung ke API dengan memperbarui konfigurasi klien Anda dengan URL dasar yang benar dan kunci API yang valid. Setiap permintaan memerlukan header Authorization standar menggunakan kunci unik Anda.
Daftar dengan Google atau email untuk menerima kunci Anda secara instan. Kunci ini memberikan akses ke model uncensored untuk generasi konten dewasa yang sah.
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"}]
}'
Endpoint Chat Completions
Kirim prompt teks ke chat/completions endpoint untuk menerima respons yang dihasilkan. Endpoint ini menerima payload yang kompatibel dengan OpenAI standar.
Spesifikkan ID model sebagai uncensored untuk memastikan model menjawab tanpa penolakan untuk topik dewasa. API memproses input teks dan mengembalikan output teks secara efisien.
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);Streaming
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)