EN ▾
[API Aicharacter]Start now
API Aicharacter(3)

API Documentation

Get started with our uncensored LLM API in minutes. This guide covers the base URL, authentication, and a working code example to help you integrate the model into your application.

Quickstart: Your first request

Send your first message to the uncensored model immediately. Use the standard chat-completions endpoint to generate text. The model responds to natural language prompts without content refusals for lawful adult use. This setup works with any OpenAI-compatible client.

Start by installing the SDK for your preferred language. Then configure your API key. The following example shows a basic curl request to test connectivity.

You can adjust parameters like temperature to control randomness. The response returns generated text directly. This simple flow lets you verify the API works before building complex logic.

curl https://api.apiaicharacter.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "What is the current API rate limit status?"}]
  }'

Base URL and Authentication

Connect using the dedicated base URL for this API. Replace the default endpoint with our hosted server address. This ensures your requests reach the uncensored model directly. Authentication relies on a single API key per account.

Generate your key via the dashboard. Pass it in the Authorization header as a Bearer token. This method is compatible with standard OpenAI SDKs. You can switch providers by changing only the base URL and key.

Keep your key secure. It grants full access to your prepaid credit. The key replaces any previous active key immediately upon generation.

Endpoints: Chat Completions

Interact with the model via the chat completions endpoint. This is the only text generation endpoint available. It accepts messages and returns generated text. No embeddings, images, or audio are supported.

Send a POST request to the chat route. Include your system and user messages in the body. The model processes the context and generates a response. You can use JSON mode for structured output.

Function calling is also supported. Define tools and let the model decide when to use them. This flexibility allows for complex agent workflows. The response includes the generated content and token usage.

from openai import OpenAI

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

Parameters: Temperature, Top P, and Stop

Control the output style using standard parameters. Adjust temperature to change creativity. Lower values make responses more deterministic. Higher values introduce more variety.

Use top P to filter unlikely words. This helps maintain coherence while allowing creativity. Set stop sequences to end generation at specific markers. This is useful for controlling dialogue structure.

The seed parameter allows for reproducible results. Use it when debugging your prompts. These parameters give you precise control over the model's behavior. Fine-tune them to match your application's needs.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apiaicharacter.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 and Token Usage

Receive responses in real-time using server-sent events. Streaming reduces perceived latency for users. The API sends tokens as they are generated. This creates a smoother reading experience.

Token usage is reported in the final chunk. This allows you to track costs accurately. Billing is based on actual tokens consumed. Errors and refusals do not incur charges.

Implement a stream handler to process the data. Update your UI as tokens arrive. This approach is ideal for chat interfaces. The model supports streaming for all request types.

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)

Rate Limits and Constraints

Understand the limits to avoid service interruptions. You can make 300 requests per minute per key. Concurrent requests are capped at eight simultaneously. The request body must not exceed 8 MB.

Handle errors gracefully. A 401 status means your key is invalid. A 402 status indicates insufficient credit. A 429 status signals that you have hit the rate limit.

The context window supports 100,000 tokens total. This includes both prompt and completion. Max output is 16,000 tokens per request. Set max_tokens to control output length. Errors are free, so retry logic is safe.

Common questions

What is the character.ai API alternative for uncensored apps?

This API offers an uncensored LLM alternative for building NSFW-tolerant apps. It uses the same chat-completions structure as the character.ai API but provides direct control over moderation and prompts. You can integrate it into existing projects by updating the base URL.

How do I handle rate limits and errors?

Limits are 300 requests per minute and eight concurrent requests. Errors like 401 (invalid key) or 402 (no credit) require action. A 429 error means you should wait before retrying. Errors do not consume credit, so you can retry safely.

What is the context window size?

The model supports a 100,000 token context window. This total includes both input and output tokens. You can specify a max output of 16,000 tokens. This allows for long conversations without losing context.

Get your API key now

Register, copy your key, and update your base URL. That is all the configuration required.

Start now