Restrictions No AIQuickstart: Connect your code
Quickstart: Connect your code
Connect your code to our uncensored LLM via a standard OpenAI-compatible interface. This quickstart guides you through authentication, request structure, and streaming for high-volume NSFW content generation.
Installation and configuration
The API key authenticates your requests. Generate one instantly via the dashboard using Google or email and password. No phone number is required. Store the key in your environment variables. It grants access to the single uncensored model. You can replace a key if needed, but only one remains active at a time. The base URL directs traffic to our servers. It works with any OpenAI-compatible client library. Change the base_url parameter to point here. This eliminates complex proxying or routing logic. Your prompts and completions are counted against your prepaid credit. Errors do not consume tokens. This ensures you only pay for actual generation.
Making your first chat completion
Send a POST request to /v1/chat/completions with your model ID. Use "uncensored" as the model value. Include your system and user messages in the messages array. The API returns the generated text. No content filters block lawful adult topics. You can adjust parameters like temperature or top_p. These control randomness and creativity. Set max_tokens to limit output length. The default is 2,048 tokens. You can extend this up to 16,000 tokens. The context window supports 100,000 tokens total. This allows for long, detailed roleplays. Keep your requests under 8 MB. This limit ensures stable performance for large payloads.
Handling streaming responses
Streaming delivers tokens as they are generated. This reduces perceived latency for users. Set stream: true in your request. The API returns a Server-Sent Events (SSE) stream. Each chunk contains partial content. You can concatenate these chunks to form the full response. The final chunk includes token usage statistics. This helps you track credit consumption accurately. Streaming is ideal for real-time chat interfaces. It provides immediate feedback during generation. Error handling remains consistent whether streaming or not. Check the status code for failures. A 402 error indicates insufficient credit. A 401 error means your key is invalid. Retry logic should account for these specific codes.
Using function calling and tools
Define tools in your request to enable function calling. The model can return structured data for your app. Specify tool_choice to control invocation behavior. Use "auto" for automatic selection. Pass the tool definitions in the tools array. The model responds with function calls when appropriate. You execute the function and send the result back. The model continues the conversation based on the output. This supports complex logic in roleplay bots. You can define multiple tools for different actions. The API handles the parsing and routing. Ensure your tool schemas are valid JSON. This prevents errors during the function call process.
Enforcing JSON mode
Force the model to output valid JSON. Set response_format to {"type": "json_object"}. This ensures structured data for parsing. Use this for game states or API responses. The model will not add markdown formatting. It returns raw JSON only. This is useful for automated workflows. You can parse the output directly in your code. Errors in JSON structure are rare but possible. Validate the output in your application layer. This adds a safety net for production systems. JSON mode works alongside function calling. You can combine both for complex interactions. The context window applies to the entire exchange. Plan your token usage accordingly to stay within limits.
Limits, errors, and context window
You are limited to 300 requests per minute per key. Concurrent requests are capped at 8 per key. Request bodies must not exceed 8 MB. These limits prevent server overload during peak usage. Errors return standard HTTP status codes. 401 indicates an invalid or expired key. 402 signals that your prepaid credit is depleted. 429 means you have exceeded the rate limit. Wait before retrying after a 429 error. The context window is 100,000 tokens. This includes both prompt and completion tokens. Long conversations may require truncation strategies. Manage your token usage to avoid unexpected costs. Credit never expires, so you can pause usage anytime. This flexibility suits intermittent high-volume generation.
cURL
curl https://api.restrictionsnoai.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List three spicy dialogue lines for a vampire character"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.restrictionsnoai.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.restrictionsnoai.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 primary keyword for this uncensored AI API?
The primary keyword is 'AI no restrictions'. This reflects our core offering of an uncensored LLM without content filters. It targets developers seeking a no filter AI for adult content generation.
How do I handle errors during streaming?
Check the HTTP status code in each chunk or the final response. A 402 error means you need to top up your crypto credit. A 401 error indicates an invalid API key. Handle these by updating your credentials or adding funds.
Is the uncensored chatbot suitable for roleplay?
Yes, it is designed for roleplay and creative writing. The model does not refuse lawful adult topics. You can generate NSFW content without restrictions. The 100,000 token context window supports long, consistent narratives.
Secure your endpoint key
Register, copy the token, update the base URL. That is the entire configuration.