Cursor API ドキュメントとクイックスタート
この無制限のLLMはOpenAI互換API上で動作し、独自のCursor APIキーを挿入するか、直接統合のために新しいキーを生成することができます。
認証とベースURLのセットアップ
クライアントをベースURLに接続してください。 https://api.cursorapi.cc/v1 認証ヘッダーにキーを渡します。システムは標準的なBearerトークン認証を使用するため、エンドポイントを更新するだけで、任意のOpenAI SDKがそのまま動作します。
/v1/chat/completions へのリクエスト送信
次の POST /v1/chat/completions モデルIDが設定されたエンドポイント uncensored. このモデルは法的な大人向けコンテンツに対して拒否なしで回答し、出力を完全に制御できます。実際のトークン使用分のみに対して課金され、エラーは無料のため、サイレントフォールトに対してクレジットを無駄にすることはありません。
cURL
curl https://api.cursorapi.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Summarize the key differences between the two models."}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.cursorapi.cc/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.cursorapi.cc/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)