Quickstart guide for developers
This quickstart guide shows you how to integrate our uncensored, OpenAI-compatible API into your development workflow using a standard cursor API key.
Prerequisites: your API key
Generate your key immediately after signing in. Visit the Get API key page and authenticate with Google or an email password. The interface displays your unique key instantly with no phone number required. Keep this string secure because it authenticates all requests to the base URL. You receive $0.50 of trial credit automatically, which expires in seven days if unused.
Configuring Cursor for OpenAI compatibility
Point your client to our specific endpoint to ensure correct routing. Set the base URL to HTTPS://api.keyapicursor.com/v1 and inject your key into the authorization header. This configuration works with any standard OpenAI-compatible SDK without modifying the model name. You must specify the model identifier as uncensored to receive the open-weight output.
Sending your first request
Execute a simple completion to verify connectivity and latency. Use the curl command below to send a basic prompt to the chat completions endpoint. The response returns a JSON object containing the generated text. Check the usage field to confirm token consumption matches your expectations.
Handling streaming responses
Stream tokens for lower perceived latency in interactive applications. The server sends Server-Sent Events containing partial deltas until the final chunk includes the total usage data. Parse these events to update your user interface in real time. This method works identically across Python and Node clients.
Integrating with Python and Node SDKs
Reuse existing codebases by adjusting only the base URL and key parameters. The Python snippet demonstrates direct integration with the official client library. The Node example follows the same pattern for JavaScript environments. Both methods support JSON mode and function calling out of the box.
Understanding rate limits and tokens
Monitor your request volume to avoid service interruptions during heavy usage. The system enforces a limit of 300 requests per minute per key. You can run eight concurrent requests simultaneously with an 8 MB body limit. Errors like 401 invalid keys or 402 insufficient credit do not consume your prepaid balance.
cURL
curl https://api.keyapicursor.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Fix syntax error in function parseData"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.keyapicursor.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.keyapicursor.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);Streaming
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)Frequently asked questions
How do I get a cursor API key?
Navigate to the Get API key page and sign in using Google or an email password. Your unique key appears immediately on the dashboard without requiring phone verification.
What happens if I hit the rate limit?
The API returns a 429 status code indicating you have exceeded the 300 requests per minute threshold. Wait briefly before retrying, or upgrade your prepaid credit volume to handle sustained traffic spikes.
Does the uncensored model support function calling?
Yes, the uncensored model supports tool usage and JSON mode. You can define functions in your request and receive structured JSON responses suitable for programmatic workflows.
Get your key in seconds
Sign up, copy your key, update the base URL. That is all.