Uncensored AIQuickstart
Uncensored AI API Documentation
Start generating uncensored text with a single HTTP call to our openai compatible API. This guide covers the essentials for rapid integration and immediate usage.
https://api.uncensoredaitextgenerator.com/v1uncensored
Authentication and Base URL
Connect to the uncensored LLM API by updating your base URL and providing a valid API key. The service endpoint is HTTPS://api.uncensoredaitextgenerator.com/v1. You obtain your key by signing up with Google or an email address on the dashboard. No phone number is required. The key grants access to the uncensored model and must be sent in the Authorization header. Keep this credential secure to avoid unauthorized token usage. Our infrastructure handles the heavy lifting while you focus on application logic.
Chat Completions Endpoint
Send messages to the /v1/chat/completions endpoint to receive text responses. This endpoint accepts standard JSON payloads containing user and assistant roles. The model processes your input and returns generated text. Use this method for both simple queries and complex multi-turn conversations. It is the primary interface for the uncensored AI text generator. You can adjust parameters to control creativity and response length. Errors return standard HTTP codes for easy debugging.
Streaming Responses and SSE
Enable real-time output by setting the stream parameter to true. The API returns Server-Sent Events (SSE) as tokens become available. This reduces perceived latency for end-users significantly. Each chunk contains partial text and usage metadata in the final event. Implement a simple event listener to handle the incoming data stream efficiently. This approach is ideal for chat interfaces requiring instant feedback loops. It ensures a smooth user experience during long generation tasks.
Function Calling and JSON Mode
Structure your outputs precisely using function calling or JSON mode. Define tools in your request to guide the model toward specific formats. The uncensored model adheres strictly to these instructions for reliable parsing. Use response_format set to json_object for strict JSON compliance. This feature supports automated workflows and data extraction tasks. You can pass tool definitions to enable dynamic behavior. Combine this with temperature settings for optimal structure and creativity balance.
Parameters: Temperature, Top-P, and Stop Sequences
Control generation behavior with standard LLM parameters. Set temperature between 0 and 2 to adjust randomness. Adjust top_p for nucleus sampling to refine word choice diversity. Use the stop parameter to halt generation at specific phrases. These controls allow fine-tuning for creative writing or factual responses. The uncensored model respects these limits without unexpected refusals. Experiment with combinations to find the perfect tone for your use case. Default values work well for general purposes.
Token Usage and Billing Metrics
Billing is based on actual token consumption with no hidden fees. Input tokens cost $0.15 per million, while output tokens cost $0.50 per million. Errors and refusals do not incur charges. Your prepaid credit covers usage until depleted. The context window supports up to 100,000 tokens total. Max output is 16,000 tokens per request. Top-ups via crypto include bonus credits. Monitor usage via the response headers or final SSE event. No monthly subscriptions apply to your account.
cURL
curl https://api.uncensoredaitextgenerator.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Check my API key validity and latency stats"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredaitextgenerator.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.uncensoredaitextgenerator.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
How do I make my first request to the uncensored AI API?
Install your preferred SDK or use curl to POST to the chat completions endpoint. Include your API key in the Authorization header and set the base URL correctly. Send a message payload to receive an immediate text response from the model.
What happens if my API key is invalid?
The server returns a 401 Unauthorized error. Verify that you copied the key correctly from your dashboard. Ensure you are using the correct base URL for the uncensored service. Regenerate your key if necessary.
Can I stream responses for a better user experience?
Yes, set the stream parameter to true in your request. The API sends incremental chunks of text as they are generated. This allows your application to display output in real-time without waiting for the full response.