ja ▾
キーを取得

Uncensored OpenAI 互換 API

APIドキュメント

標準的なOpenAI互換クライアントをベースURLにポイントし、APIキーを書き換えてフィルタリングなしLLM APIを開始しましょう。このクイックスタートでは、認証、最初のリクエスト、ストリーミング、および知っておくべき技術的制限事項を解説します。

ベースURLと認証

ベースURLで認証することから始めましょう https://api.googlegeminiuncensored.com/v1Googleまたはメール経由でサインアップすると、すぐに1つのアクティブなAPIキーを受け取ります。このキーを Authorization すべての後続リクエストに対して Bearer トークンとしてヘッダーを設定します。

  • ベースURL: https://api.googlegeminiuncensored.com/v1
  • ヘッダー: Authorization: Bearer YOUR_API_KEY
curl https://api.googlegeminiuncensored.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "List the top five open source LLMs for local deployment"}]
  }'

チャット完了エンドポイント

にテキスト生成リクエストを送信します。 POST /v1/chat/completions. このエンドポイントは標準的なメッセージ配列を受け取り、法的な成人用途向けのコンテンツフィルタなしの生テキスト応答を返します。

from openai import OpenAI

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

モデルIDは uncensoredGPTやGeminiとは異なる当社のサーバー上で動作するオープンウェイトモデルです。ベンダー間のルーティングは行わず、埋め込みも提供しません。

ストリーミングレスポンス(SSE)

streamをtrueに設定してストリーミングを有効にする stream: true リクエストボディに記述します。APIはトークン使用データが最終チャンクに表示されるServer-Sent Events (SSE)を返します。

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.googlegeminiuncensored.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)

キーを生成

登録、キーのコピー、エンドポイントURLの更新。数秒で完全セットアップ。

キーを取得