驗證設定
在 取得 API 金鑰 頁面。您可以使用 Google 登入,或使用電子郵件與密碼;無需提供電話號碼。您的金鑰會立即顯示。請將其用於 Authorization header 用於所有請求。每個帳戶僅允許一個有效金鑰。新金鑰會立即取代舊金鑰。
POST /v1/chat/completions
將文字請求发送至聊天完成端點。基礎 URL 為 HTTPS://api.proxyclaudecode.com/v1。使用模型 ID "uncensored" 以取得直接存取。此端點處理文字輸入和輸出。它不支援嵌入、圖像或微調。您可以調整 temperature 和 top_p 等參數。錯誤和拒絕不會消耗信用額度。
cURL
curl https://api.proxyclaudecode.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Parse this CSV and return JSON"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.proxyclaudecode.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.proxyclaudecode.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)