fi ▾

Uncensored ai Agent API Documentation & Quickstart

Get started with the uncensored AI agent API in minutes. Use standard OpenAI-compatible endpoints to generate unrestricted text with zero hidden refusals.

Base URL and authentication setup

The uncensored LLM API operates on a single base URL that replaces the standard OpenAI endpoint. You authenticate using a bearer token generated from your account dashboard. This setup allows you to swap your existing client configurations without rewriting core logic. Every request must include the Authorization: Bearer YOUR_API_KEY header. If the key is missing or invalid, the API returns a 401 error immediately. This ensures you know exactly when your credentials fail.

curl https://api.uncensoredaiagent.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "What is the capital of France"}]
  }'

POST /v1/chat/completions endpoint guide

The core functionality lives in the chat-completions endpoint. Send your prompt as a JSON object with the model ID set to uncensored. The API processes the request and returns the generated text. You can control the output style using parameters like temperature or top_p. This endpoint supports both synchronous and streaming responses. It is designed for high-throughput automation tasks.

from openai import OpenAI

client = OpenAI(base_url="https://api.uncensoredaiagent.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)

GET /v1/models endpoint details

Verify your connection by listing available models. This endpoint confirms which models are active and ready for inference. It returns a JSON object containing the model ID and metadata. Use this to debug connectivity issues before sending heavy payloads. It is a lightweight check that consumes negligible tokens.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.uncensoredaiagent.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 responses and token usage

Enable streaming by setting stream: true in your request. The API sends data chunks via Server-Sent Events (SSE). Each chunk contains partial text. The final chunk includes token usage statistics for billing accuracy. This approach reduces perceived latency for end-users. You can process tokens in real-time as they arrive.

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)

Parameters: temperature, top_p, and JSON mode

Control creativity with temperature and top_p settings. Higher values produce more diverse outputs. Lower values ensure deterministic results for coding tasks. Use response_format: {"type": "json_object"} for structured data. This forces the model to return valid JSON without extra markdown. It is ideal for parsing into your own applications. You can also set max_tokens to cap output length. The default max output is 16,000 tokens.

Rate limits and request constraints

Each API key allows 300 requests per minute. You can have 8 concurrent requests active at any time. The maximum request body size is 8 MB. If you exceed the rate limit, you receive a 429 error. Wait before retrying or upgrade your throughput needs. The context window supports 100,000 tokens total. Errors and refusals do not consume your prepaid credit. This ensures you only pay for successful completions. A 402 error indicates insufficient funds.

Frequently asked questions

What is the uncensored AI agent context window limit?

The context window supports 100,000 tokens for both prompt and completion combined. This allows for long documents or extensive conversation history. Max output per request is 16,000 tokens unless specified otherwise.

How do I handle errors like 401 or 429?

A 401 error means your API key is invalid or missing. A 429 error indicates you have exceeded the 300 requests per minute limit. Retry after a short delay or check your key validity. Use the dashboard to generate a new key if needed.

Does the uncensored AI agent API support streaming?

Yes, streaming is supported via Server-Sent Events. Set <code>stream: true</code> to receive partial responses in real-time. The final chunk includes token usage data for billing. This reduces latency for interactive applications.

Generate your API key

Sign up, copy your key, update the base URL. Setup takes seconds.

Get your key