身份驗證與基礎 URL
您的 API 金鑰用於驗證每一次請求。請將其放在 Authorization 作為 Bearer token 標頭。基礎 URL 直接指向我們的端點。
使用 Google 或電子郵件註冊後,從儀表板即時檢索您的金鑰。無需電話驗證。
端點是 https://api.unsupportedcodexauthmethodapikey.com/v1. 用於所有 HTTP 請求。
curl https://api.unsupportedcodexauthmethodapikey.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Parse the JSON string in the request body"}]
}'
POST /v1/chat/completions
向此端點發送您的提示詞。模型 ID 始終為「uncensored」。API 根據您的輸入回傳文字完成內容。
包含您的系統提示詞以定義行為。模型在合法成人用途下不會拒絕內容。
配置類似 temperature 和 top_p 的參數 temperature 和 top_p 控制創造力。使用 json_object 用於結構化輸出。
from openai import OpenAI
client = OpenAI(base_url="https://api.unsupportedcodexauthmethodapikey.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)
GET /v1/models
查詢可用模型。此端點列出單一 uncensored 模型 ID。它確認您的 API 金鑰有效。
使用此方法在發送大量負載前驗證連線。回應包含關於模型的元數據。
僅提供一款模型。這是一款開放權重模型,針對自由與隱私進行了調優。
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unsupportedcodexauthmethodapikey.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: true. 透過伺服器發送的事件 (SSE) 接收 token。token 使用詳情出現在最後一個區塊。
設定 max_tokens 以限制輸出。若未指定,預設為 2,048 個 token。每次請求的最大輸出為 16,000 個 token。
使用 stop 序列以停止生成。上下文視窗總共為 100,000 個 token。
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)
錯誤處理
優雅地處理錯誤。401 狀態表示您的無效。402 狀態表示信用額度不足。
429 狀態表示已觸發速率限制。您每分鐘限額為 300 次請求。請檢查 Retry-After 標頭。
因內容限制而拒絕的請求會返回 400。請求格式錯誤也會返回 400。錯誤不會產生計費。
Limits and Context Window
上下文視窗為 100,000 個 token。這包含提示詞與補全內容。請求主體大小上限為 8 MB。
每個金鑰的並行請求限制為 8 個。速率限制為每分鐘 300 次請求。超過這些限制將返回 429。
信用永不過期。錯誤免費。只為實際使用的 token 付費。隨時使用加密貨幣充值。
常見問題
無審查 Codex 的驗證方法:apikey 為何?
它是 Bearer token 驗證方法。在 Authorization 標頭中傳送您的金鑰。該 API 使用標準的 OpenAI 相容協議。
加密貨幣付款是如何運作的?
使用 USDT (TRC20) 或 USDC (Base) 充值。金額範圍為 $20 至 $500。較大金額適用贈送餘額。
您接受哪些付款方式?
僅限加密貨幣:TRC20 上的 USDT 或 Base 上的 USDC,任何整數金額從 $20 到 $500。從 $50 起享有額外餘額獎勵。
立即取得金鑰
註冊,複製金鑰,更新端點 URL。這就是完整的流程。