Uncensored LLM API Quickstart
Get your uncensored LLM API key and start generating text immediately. This guide covers the essential steps to integrate our openai compatible service into your workflow.
https://api.apiintelligenceartificielle.com/v1
Prerequisites and base URL
Your uncensored artificial intelligence journey begins with a base URL. Use https://api.apiintelligenceartificielle.com/v1 for all requests. This endpoint routes directly to our uncensored model without external proxies. You need an API key, which you generate on the key page. No phone number is required for registration. Use Google or an email password to sign in. The interface displays your key immediately after creation. Keep this key secure, as it authenticates your token usage.
Authentication and headers
Every request requires your API key in the Authorization header. Format the header as Bearer YOUR_API_KEY. This standard method ensures compatibility with existing tools. Our NSFW API accepts this header for both text and streaming responses. Do not include the key in the URL query string unless necessary. The system validates the key before processing tokens. An invalid key results in a 401 error. A missing key prevents any request from succeeding. Verify your key exists before sending large payloads.
Sending your first request
Send a POST request to /v1/chat/completions with your model ID. Use uncensored as the model name. The request body must include a messages array. Each message has a role and content. Here is a basic cURL example to get started.
curl https://api.apiintelligenceartificielle.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "What is the latest version of the Python SDK"}]
}'
This command sends a simple prompt to the uncensored model. The response contains the generated text. Check the choices array for the output. You can adjust the prompt length to fit your use case. The system processes the input and returns text. No complex configuration is needed for basic usage. Focus on the content structure for best results.
Handling streaming responses
Enable streaming by setting stream: true in your request. This sends partial responses as they are generated. Use Server-Sent Events (SSE) to handle the stream. The final chunk includes token usage details. This method reduces perceived latency for long outputs. Your client must parse the SSE format correctly. Buffer incoming data until the stream closes. Streaming is ideal for real-time applications. It provides immediate feedback to users. Monitor the stream for errors or disconnections. Reconnect if the connection drops unexpectedly. This approach ensures a smooth user experience.
Configuring parameters
Adjust parameters to control model behavior. Use temperature for randomness, ranging from 0 to 2. Higher values increase creativity. Lower values make outputs more deterministic. Set max_tokens to limit output length. The default is 2,048 tokens per request. You can extend this up to 16,000 tokens. Use top_p for nucleus sampling. Set stop sequences to halt generation. JSON mode is available via response_format. This ensures structured output for code integration. Experiment with these settings to find your preferred balance. The model adapts to your specific needs.
Error handling and limits
Monitor your request limits carefully. You are allowed 300 requests per minute per key. Only 8 requests can run simultaneously. The maximum request body size is 8 MB. A 401 error indicates an invalid key. A 402 error means your credit is exhausted. Top up with crypto to continue using the service. A 429 error signals rate limiting. Wait before retrying to avoid further delays. Errors and refusals do not consume credit. This protects your prepaid balance. Check the response headers for usage details. Track your token consumption to stay within limits. Plan your usage to avoid interruptions during critical tasks.
Python
from openai import OpenAI
client = OpenAI(base_url="https://api.apiintelligenceartificielle.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.apiintelligenceartificielle.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)Frequently asked questions
Is the API intelligence artificielle service compatible with OpenAI SDKs?
Yes, our API uses standard OpenAI-compatible endpoints. You can use the official OpenAI SDKs by changing the base URL. This allows seamless integration with existing codebases. No major changes are required to switch providers.
How does the uncensored LLM handle content refusals?
The model is tuned to answer without content refusals for lawful adult use. It does not block controversial or fictional topics. However, sexual content involving minors is always refused. This hard limit applies to all requests regardless of parameters.
What is the context window size for the uncensored model?
The context window is 100,000 tokens, including both prompt and completion. You can generate up to 16,000 tokens in a single request. This allows for long-form content generation. Adjust your input length to optimize performance.
Secure your API key now
Register, retrieve the token, and update your base URL. That covers the entire setup.
Try with trial credit