EN ▾
Try with trial credit

Developer Documentation

Get started with our uncensored LLM API using standard OpenAI-compatible endpoints. Send text, receive text, and bypass content filters with a single model ID.

Try with trial credit

Uncensored API. No refusals. Pay per token.

Base URL and Authentication

Use https://api.caiapi.cc/v1 as your base URL. Authenticate by passing your unique API key in the Authorization header. This standard approach lets you swap in any OpenAI-compatible SDK without rewriting your connection logic.

curl https://api.caiapi.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Get user_id 99 for account settings."}]
  }'

Your key grants access to the uncensored model. Keep it secure, as it tracks your token usage and billing directly.

First Request with Python

Initialize the client with your key and the correct base URL. Send a simple prompt to verify connectivity and response quality.

from openai import OpenAI

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

Expect a direct text response. The model ignores standard content filters, making it ideal for roleplay or creative writing.

Node SDK Integration

Install the official SDK and configure it to point to our endpoint. This ensures compatibility with existing TypeScript or JavaScript projects.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.caiapi.cc/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);

Handle the response object to extract the generated text. The structure matches standard OpenAI outputs.

Streaming Responses

Enable streaming by setting stream: true. Receive tokens as they generate, which reduces perceived latency for long outputs.

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)

Token usage details appear in the final chunk. This method is optimal for real-time chat interfaces.

Function Calling and JSON Mode

Define tools in your request to get structured outputs. Use response_format: {"type": "json_object"} to enforce strict JSON formatting.

This feature allows your application to parse model outputs programmatically. It works reliably with the uncensored model for both creative and logical tasks.

Rate Limits and Errors

Limit: 300 requests per minute. Concurrent: 8 requests per key. Error 401 means invalid key. Error 402 means no credit. Error 429 means rate limit exceeded. Context window: 100,000 tokens. Max output: 16,000 tokens.

Errors do not consume credit. Adjust your retry logic accordingly.

Common questions

Is this the c.ai API?

Yes, we host an uncensored model optimized for the C.AI community style. It offers an open-weight alternative with no content filters for lawful adult use.

What is the context window?

The model supports a 100,000 token context window. This includes both your prompt and the generated completion. Max output per request is 16,000 tokens.

Do you use my data for training?

No. Prompts sent to our API are not used for training. Your data remains private and is not used to improve the model.

Get your key in one step

Sign up, copy the key, update the base URL. That is all.

Try with trial credit