Uncensored ia API Quickstart
Get your uncensored ia API key and start sending text requests in minutes. This quickstart covers the essentials for integrating our OpenAI compatible API into your projects.
- per 1M input tokens
- $0.15
- Output tokens / 1M
- $0.50
- token context
- 100,000
- trial credit
- $0.50
- requests per minute
- 300
Installation and setup
Install the official SDK for your preferred language. Our API works with any standard OpenAI-compatible client, so you can use the libraries you already trust. The setup process requires no special configuration beyond adding the dependency to your project environment.
You will need an API key to authenticate your requests. Generate one immediately after signing up via Google or email. The key appears on your screen once, so copy it to your clipboard or secure storage right away. Keep it private to avoid unauthorized usage from your prepaid balance.
Configuration: base_url and key
Point your client to our base URL and set the API key header. Use the specific endpoint provided in your dashboard. This ensures your requests go directly to the uncensored model without any routing ambiguity. The base URL is HTTPS://api.iasemsensura.com/v1.
Set the Authorization header to Bearer YOUR_API_KEY. This header authenticates every request you send. Without the correct key, the API will reject your input with a 401 error. Always verify your key matches the one shown during signup.
Sending your first request
Send a simple chat completion request to test connectivity. Use the model ID uncensored to ensure you get the correct output. This model is tuned for unrestricted text generation. It handles roleplay and adult themes without standard refusals.
Here is a basic cURL example to get you started. Replace the placeholder with your actual API key. This command sends a short prompt and expects a direct response.
curl https://api.iasemsensura.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate 200 words of dark fantasy lore"}]
}'
Handling streaming responses
Enable streaming for real-time token generation. This is crucial for applications that display text as it is generated. The API returns events via Server-Sent Events (SSE). You receive chunks of text as they become available.
Use the Python SDK to handle streaming efficiently. The library manages the connection and yields tokens as they arrive. This approach reduces perceived latency for end users. It also allows for immediate display of partial results.
from openai import OpenAI
client = OpenAI(base_url="https://api.iasemsensura.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)
Function calling and JSON mode
Use function calling for structured data extraction or tool use. Define your tools in the request body. The model will return a JSON object with the required arguments. This feature works alongside standard text generation.
Enable JSON mode to force the output into a specific format. Set response_format to {"type": "json_object"}. This ensures the response is valid JSON. Use the Node SDK for easy integration with JavaScript environments.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.iasemsensura.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);
Understanding token usage and limits
Monitor your token usage and request limits closely. The context window supports up to 100,000 tokens per request. This includes both the input prompt and the generated output. Max output is 16,000 tokens unless you specify otherwise.
You are limited to 300 requests per minute per key. Concurrency is capped at 8 simultaneous requests. If you exceed these limits, you will receive a 429 error. Streaming responses also count towards these limits. Use the usage field in the final chunk to track consumption.
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 uncensored ia API and how does it differ from standard models?
The uncensored ia API provides access to a single, dedicated large language model optimized for unrestricted text generation. Unlike standard models, it does not refuse lawful adult, fictional, or controversial topics. It is an open-weight model hosted on our servers, ensuring consistent behavior without corporate safety filters.
How do I handle common errors like 401 or 429?
A 401 error indicates an invalid or missing API key. Verify that your key matches the one shown during signup. A 429 error means you have exceeded the 300 requests per minute limit. Wait briefly or reduce your concurrency to 8 requests per key.
Does the uncensored AI API support streaming responses?
Yes, the API supports streaming via Server-Sent Events (SSE). You can enable this in your SDK client to receive tokens as they are generated. This reduces latency and improves the user experience for chat applications. Token usage is reported in the final chunk of the stream.
Access via single form
Register, retrieve your key, update the base URL. That is all configuration required.