Uncensored api documentation
Drop our uncensored API into any existing project with a single base URL change. You get consistent generation, transparent crypto pricing, and zero subscription locks.
Quick Start: Install and Configure the SDK
Start by pointing your client at our base URL and passing your API key. The endpoint is https://api.claudeapitokencosts.com/v1 and requires no complex routing logic.
Authentication uses a standard bearer token in the Authorization header. You can generate your key instantly via Google or email.
Our service is fully OpenAI-compatible. You can use the official SDKs without modifying your core logic. Just update the base URL and inject your key.
Use curl to verify connectivity immediately.
Basic Chat Completion Request
Send a POST request to /v1/chat/completions to get text output. This endpoint handles all standard chat interactions.
Define your system prompt and user message in the JSON body. The model ID is always uncensored.
The API returns a direct text response. You do not need to parse complex streaming objects for simple use cases.
This approach works for simple scripts or batch processing jobs. Use curl to test your first call.
Streaming Responses with Server-Sent Events
Enable streaming by setting stream: true in your request. The server returns chunks as they are generated.
This method reduces perceived latency for long outputs. It also allows your application to display tokens in real time.
Each chunk contains partial data and usage statistics in the final payload.
Handle the SSE stream in your client code to process tokens as they arrive. This is critical for interactive applications.
Function Calling and JSON Mode
Support structured output using the response_format parameter. Set it to {"type": "json_object"} for strict JSON replies.
You can also define tools for function calling. The model respects the tool definitions provided in the request.
This ensures reliable data extraction for your pipelines. Combine JSON mode with tools for complex workflows.
Our model handles structured data generation efficiently.
Parameters: Temperature, Top P, and Seed
Control creativity with temperature and top_p. Higher values increase randomness. Lower values make outputs more deterministic.
Use the seed parameter for reproducible results. This is useful for debugging or testing specific prompts.
Set max_tokens to limit output length. The default is 2,048 tokens per request.
Adjust these settings to fit your specific use case. Balance consistency with variety as needed.
Understanding Token Usage and Costs
You pay only for tokens consumed. Input tokens cost $0.15 per million. Output tokens cost $0.50 per million.
Errors and refusals do not consume credit. You only pay for successful completions.
Use the token calculator to estimate costs before sending large batches. Our pricing is transparent and usage-based.
No monthly fees or subscription locks apply. Credit never expires. You can top up with crypto anytime.
Monitor your usage via the final chunk in streaming responses.
cURL
curl https://api.claudeapitokencosts.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Run the unit tests and show me the output"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.claudeapitokencosts.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.claudeapitokencosts.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)Common questions
What is the claude API token costs for this service?
Our pricing is $0.15 per million input tokens and $0.50 per million output tokens. This is a flat rate with no hidden fees or subscription requirements. You pay only for what you use.
How do I handle rate limits and errors?
The API returns a 429 status code when you exceed 300 requests per minute. A 401 error indicates an invalid API key. A 402 error means you need to add more credit. These errors are standard and easy to handle in code.
What is the context window size?
The context window is 100,000 tokens for the combined prompt and completion. You can request up to 16,000 tokens in a single output. This allows for substantial context without hitting limits quickly.
Access your key via a simple form
Register, copy your key, update the base URL. That is the complete configuration.