繁中 ▾
立即開始
立即開始

快速上手:無審查 API 指南

在幾分鐘內使用標準基礎 URL 和 API 金鑰將您現有的 OpenAI 相容客戶端連接到我們的無審查 LLM API。本指南涵蓋直接存取模型所需的關鍵端點、串流傳輸和工具整合。

驗證設定

在 取得 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)

保護您的 API 金鑰

註冊、取得金鑰,並更新您的基礎 URL。設定簡單。