Base URL 및 인증
베이스 URL로 인증하는 것으로 시작하세요 https://api.googlegeminiuncensored.com/v1구글 또는 이메일로 가입한 직후 즉시 단일 활성 API 키를 받게 됩니다. 이 키를 사용하여 Authorization 모든 후속 요청에 대해 Bearer 토큰으로 헤더를 사용합니다.
- Base 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는 토큰 사용량 데이터가 마지막 청크에 나타나는 서버 전송 이벤트(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)