Uncensored API quickstart guide
Get your uncensored API key and start sending text to text requests in minutes. This guide covers the essentials for integrating our OpenAI-compatible endpoint into your existing workflows.
Install the official OpenAI SDK
Start by installing the standard library used by most developers. This package handles the HTTP protocol for you.
- Python:
pip install openai - Node.js:
npm install openai
Once installed, you are ready to configure the connection details.
Configure your base URL and API key
Point your client to our specific endpoint instead of the default provider. Use the base URL below for all requests.
- Base URL:
https://api.preciotokensclaude.com/v1 - Model ID:
uncensored
Your API key appears immediately after signup via Google or email.
Make your first chat completion request
Send a simple text prompt to test the integration. The model responds with text output only.
This example uses cURL to verify connectivity.
curl https://api.preciotokensclaude.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Count the tokens in this 500 word essay"}]
}'The response contains the generated text and token usage statistics. Errors like 401 or 402 indicate authentication or credit issues.
Enable streaming for real-time responses
Use Server-Sent Events for lower latency. Tokens appear as they are generated.
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)Streaming is ideal for chat interfaces. Each chunk includes usage data in the final payload.
Use function calling and JSON mode
Define tools for structured data extraction. Set response_format to {"type": "json_object"} for strict JSON.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.preciotokensclaude.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);Both streaming and function calling work together. You can parse structured outputs directly in your application logic.
Limits, errors, and context window
Monitor your usage to avoid interruptions. The context window supports 100,000 tokens total. Max output is 16,000 tokens per request.
Rate limits are 300 requests per minute. A 429 error means you hit the cap. Check your credit balance before heavy loads.
Python
from openai import OpenAI
client = OpenAI(base_url="https://api.preciotokensclaude.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)Common questions
How much does the uncensored API cost per token?
Input tokens are $0.15 per million. Output tokens are $0.50 per million. You pay for real usage, not subscriptions.
What is the maximum context window?
The model supports 100,000 tokens total. This includes both prompt and completion tokens combined.
Which payment methods do you accept?
Crypto only: USDT on TRC20 or USDC on Base, any whole amount from $20 to $500. Bonus credit applies from $50.