Installation and Setup
Start by creating an account to receive your API key. Sign up using either a Google account or an email and password combination. The system displays your unique key immediately on screen. No phone number verification is required for this step. You can generate a new key at any time, but only one active key exists per account. A new key replaces the previous one instantly. Keep this key secure as it grants access to your prepaid credits. Use these credentials with any standard OpenAI-compatible SDK to begin integration.
Base Configuration
Point your client to our dedicated base URL for uncensored requests. Use the standard BASE_URL parameter to route traffic correctly. The endpoint structure mirrors OpenAI conventions for easy switching. You must provide your API key in the Authorization header. Set the model ID to uncensored in your configuration object. This ensures the request targets the correct uncensored large language model. Verify your connection by listing available models via the /v1/models endpoint. This confirms your authentication is valid before sending heavy payloads.
Sending Requests
Make a standard POST request to the chat completions endpoint. Your payload must include the model field set to uncensored. Pass your messages in an array under the messages key. The system accepts standard role definitions like user and assistant. Input tokens are charged at a transparent rate of $0.15 per million tokens. Output tokens cost $0.50 per million tokens. Errors do not consume your prepaid credit. This billing model ensures you only pay for actual generated text. Use the following cURL command to send your first message.
Streaming Responses
Enable streaming by setting stream to true in your request. The server returns a Server-Sent Events (SSE) stream. Each chunk contains a portion of the generated text. The final chunk includes the complete token usage statistics. This allows you to display text to users in real-time. Streaming works identically across all supported SDKs. Ensure your client handles partial text buffers correctly. Use this method for long-form content generation or interactive chat interfaces. The following example demonstrates how to handle the stream in Python.
Function Calling
Define tools in your request using the tools parameter. The model returns structured tool calls when appropriate. You can specify tool_choice to force specific behavior. Pass the tool response back to the model for further processing. This supports complex workflows requiring external API interactions. The model handles JSON formatting automatically when needed. Ensure your function definitions match the expected schema. This feature works alongside standard temperature and top-p settings. Use Node.js to implement tool handling efficiently.
JSON Mode and Limits
Request strict JSON output by setting response_format to {"type": "json_object"}. The model guarantees valid JSON structure in the response. This is ideal for parsing data in your application logic. Be aware of the 100,000 token context window limit. This covers both the prompt and the completion combined. The maximum output per request is 16,000 tokens. If you do not specify max_tokens, the limit defaults to 2,048. Requests are limited to 300 per minute per key. Concurrent requests are capped at eight simultaneously. The request body must not exceed 8 MB. Handle errors gracefully as shown in the following stream example.
cURL
curl https://api.modelsuncensoredopenrouter.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list three json keys"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.modelsuncensoredopenrouter.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.modelsuncensoredopenrouter.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)