URL Asas dan Pengesahan
URL asas ialah https://api.aiwithoutfilters.com/v1. Lulus kunci anda dalam Authorization pencap sebagai Bearer YOUR_API_KEY. Anda mendapat satu kunci per akaun, dibuat serta-merta melalui Google atau e-mel. Hujung ini memulangkan ID model tersedia anda dan mengesahkan status pengesahan anda tanpa menggunakan kredit.
Permintaan Pertama
Hantar permintaan penyelesaian chat standard ke POST /v1/chat/completions. ID model ialah uncensored. Hujung sambungan ini mengendalikan interaksi teks masuk dan teks keluar tanpa beban tambahan.
Berikut adalah contoh curl asas untuk menguji sambungan anda dan melihat model menjawab arahan mudah.
Kos: Token input dikenakan caj pada $0.15 per 1M token. Token output berharga $0.50 per 1M token.
curl https://api.aiwithoutfilters.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List all active ports on localhost using curl"}]
}'
Integrasi SDK Python
Gunakan SDK Python OpenAI rasmi untuk berinteraksi dengan API kami. Tetapkan base_url dan api_key sebelum membuat panggilan. Ini membolehkan anda mengekalkan struktur kod sedia ada sambil menukar model backend.
Petik kod berikut menunjukkan cara mengkonfigurasi klien dan menghantar mesej ke model tanpa sensor.
from openai import OpenAI
client = OpenAI(base_url="https://api.aiwithoutfilters.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.aiwithoutfilters.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);Aliran
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)