驗證與 Base URL 設定
在儀表板生成您的 API 金鑰。基礎 URL 為 HTTPS://api.grokkey.com/v1。在 Authorization 標頭中傳遞您的金鑰。拒絕免費。充值僅限加密貨幣。
聊天完成端點
將文字提示发送至聊天端點。模型 ID 為 "uncensored"。它不是 GPT 或 Grok。上下文為 100k tokens。最大輸出為完整視窗。錯誤不會扣除信用額度。
配置 temperature 和 top_p 等參數。API 僅返回文本,無嵌入向量或圖像。使用標準 JSON 格式進行請求和回應。
串流與 Token 使用
透過設定 stream: true. 接收 SSE 區塊。token 使用量出現在最後一個區塊。這允許即時顯示。它也有效處理大量輸出。用於聊天介面。
函式呼叫 & JSON 模式
使用工具進行結構化輸出。設定 response_format 以 {"type": "json_object"} 用於嚴格的 JSON。函式呼叫支援 tool_choice。這可實現可靠的整合。用於資料提取。它與 uncensored 模型相容。確保您的提示詞清晰明確。
速率限制與限制條件
限制為每分鐘 300 次請求。最大並發請求為 8。請求主體最大值為 8 MB。每個帳戶一個密鑰。用新密鑰替換舊密鑰。限制防止濫用。監控你的使用情況。信用額度永不過期。僅為使用的 token 付費。
模型規格
模型 ID:"uncensored"。開放權重模型。針對成人內容調校。不對您的提示進行訓練。100k 上下文視窗。無獨立輸出上限。參數:temperature, top_p, stop, seed, presence_penalty, frequency_penalty。無 SLA。無認證。直接 API 存取。
cURL
curl https://api.grokkey.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 Rust crates for high throughput networking"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.grokkey.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.grokkey.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)