ベースURLと認証
ベースURLは https://api.aiwithoutfilters.com/v1キーをに渡します Authorization ヘッダーは Bearer YOUR_API_KEY. アカウントごとに1つのキーが、Googleまたはメール経由で瞬時に作成されます。このエンドポイントは利用可能なモデルIDを返し、クレジットを消費せずに認証ステータスを確認します。
最初のリクエスト
標準的なチャット完了リクエストを POST /v1/chat/completions. モデルIDは uncensored. このエンドポイントはテキスト入力とテキスト出力のやり取りを、余計なものを一切含まず処理します。
接続をテストし、モデルが簡単なプロンプトにどのように応答するかを確認するための基本的な curl の例。
コスト: 入力トークンは1Mトークンあたり$0.15で課金されます。出力トークンは1Mトークンあたり$0.50です。
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"}]
}'
Python SDK統合
公式 OpenAI Python SDK で API と対話します。設定 base_url および api_key 呼び出しを行う前に。これにより、バックエンドモデルを切り替えても既存のコード構造を維持できます。
以下のスニペットは、クライアントの設定方法と uncensored モデルへのメッセージ送信方法を示しています。
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);ストリーミング
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)