無審查 API 快速入門
透過單一基礎 URL 變更,將我們的無審查 API 放入您現有的程式碼庫中。您将获得一個統一端點,用於一個不會因內容拒絕而回答的開放權重模型,使用標準 OpenAI 相容協定。
- base_url
- https://api.chatgptapiprice.com/v1
- 模型
- 無審查
安裝與設定
透過 取得 API 金鑰 頁面。您可以使用 Google 登入,或使用電子郵件與密碼;無需提供電話號碼。您的 API 金鑰會立即顯示在畫面上。您無需安裝特殊函式庫或配置複雜的路由。API 的行為與標準 chat/completions endpoint,允許您替換我們的無審查模型,無需重寫應用程式邏輯。
基礎 URL 與驗證
使用我們的專用 base URL,並在標準的 authorization header 中傳遞您的金鑰。所有請求都會路由至 https://api.chatgptapiprice.com/v1. 這可確保您的客戶端程式碼與現有工具保持相容,同時提供無過濾的輸出。身份驗證依賴標準 Authorization: Bearer <API_KEY> 格式。
- 基礎 URL:
https://api.chatgptapiprice.com/v1 - 標頭:
Authorization: Bearer YOUR_API_KEY - 模型 ID:
uncensored
curl https://api.chatgptapiprice.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "What is the price per million tokens for this API?"}]
}'
聊天完成端點
發送訊息至 POST /v1/chat/completions 端點。模型 ID 必須設定為 uncensored 存取針對較少拒絕調整的開源權重變體。您可以使用 temperature 並使用 response_format. API 接受標準訊息陣列,並帶有 system, user,以及 assistant 角色。
from openai import OpenAI
client = OpenAI(base_url="https://api.chatgptapiprice.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)
串流回應
在請求主體中將 stream: true 在你的請求中。你收到部分回應的伺服器發送事件(SSE)串流。最後一個區塊包含完整的 token 使用統計數據,讓你準確追蹤成本。此模式與 Node.js SDK 和其他事件驅動型客戶端無縫配合。
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.chatgptapiprice.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)立即取得 API 金鑰
註冊、複製權杖、更新基礎網址。只需做到這些。