id ▾

API LLM uncensored code-first

Panduan Awal API AI tanpa sensor

Integrasikan API AI uncensored kami dengan sintaks OpenAI-compatible standar untuk menghasilkan teks tanpa penolakan konten. Panduan awal ini mencakup autentikasi, permintaan, streaming, dan output terstruktur untuk aplikasi Anda.

Prasyarat dan Autentikasi

Mulai dengan membuat akun dan menghasilkan kunci API Anda. Gunakan Lanjutkan dengan Google atau berikan email dan kata sandi di Dapatkan kunci API halaman. Kunci muncul segera. Tidak diperlukan nomor telepon. Atur OPENAI_API_KEY variabel lingkungan ke nilai ini. Gunakan URL dasar ini untuk semua permintaan: https://api.uncensoredaiplatform.com/v1.

curl https://api.uncensoredaiplatform.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "set max tokens to 2048 and temperature to 0.7"}]
  }'

Mengirim Permintaan Pertama Anda

Kirim permintaan POST ke /v1/chat/completions dengan ID model uncensored. Sertakan array pesan Anda dalam body. API mengembalikan respons teks. Ini berfungsi dengan klien yang kompatibel dengan OpenAI. Ubah URL dasar dan kunci API dalam konfigurasi Anda. Gunakan struktur sederhana ini untuk menguji konektivitas.

from openai import OpenAI

client = OpenAI(base_url="https://api.uncensoredaiplatform.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.uncensoredaiplatform.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)

Dapatkan Kunci API Anda

Daftar, salin kunci, ganti URL dasar. Selesai.

Klaim kunci percobaan