Base URL and Authentication
ClauDensFW operates as an OpenAI-compatible endpoint. To route your existing SDK integrations, update your base_url to https://api.claudensfw.com/v1 and provide your unique API key in the authorization header. You can generate a key immediately on the Get API key page using Google or an email/password pair. The system issues one active key per account; generating a new key invalidates the previous one instantly.
Authentication relies on standard bearer tokens. Ensure your client sends the header Authorization: Bearer YOUR_API_KEY with every request. No additional configuration is required for the uncensored model to recognize your credentials.
Chat Completions Endpoint
Send requests to POST /v1/chat/completions using the model identifier uncensored. This endpoint accepts standard chat messages and returns text completions. Unlike consumer chat apps, this is a pure API for automation and code-first workflows.
The model supports a 100,000-token context window for both prompt and completion combined. If you do not specify max_tokens, the response can run to the end of the window. Set max_tokens only if you want to cap the output. Errors and refusals do not consume your prepaid credit.
Streaming Responses
Enable streaming by setting stream: true. The API returns Server-Sent Events (SSE) chunks as the model generates text. This reduces perceived latency for interactive applications.
Token usage statistics (input and output counts) are included only in the final chunk of the stream. This allows you to track costs accurately without buffering the entire response. Use the standard SSE parser in your SDK to handle the stream efficiently.
Function Calling & Tools
Define tools in your request body to enable function calling. The model returns structured arguments that you can parse and execute. Use the tool_choice parameter to control whether the model calls a tool or responds directly.
This feature works identically to the OpenAI tool-use format, ensuring your existing tool definitions require no changes. The uncensored model handles complex tool schemas reliably without unnecessary refusals for standard technical tasks.
JSON Mode
For strict schema compliance, set response_format to {"type": "json_object"}. This forces the model to output valid JSON, which is essential for programmatic pipelines and API integrations.
JSON mode reduces parsing errors and ensures your downstream code receives predictable structures. Combine this with function calling for robust, self-contained API agents that output executable data formats.
Limits, Errors, and Context
Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. If you exceed these limits, the API returns a 429 status code. A 401 error indicates an invalid or expired key, while a 402 error means your prepaid credit is exhausted.
Requests that fail due to rate limits or insufficient funds do not consume tokens. The context window sums prompt and completion tokens; ensure your total usage stays within 100,000 tokens to avoid truncation.
cURL
curl https://api.claudensfw.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.claudensfw.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.claudensfw.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)