EN ▾

API Documentation: Quickstart Guide

This guide covers the basics of integrating our uncensored LLM API into your application. You will learn how to authenticate, send requests, and handle responses using standard OpenAI-compatible clients.

Base URL & Authentication

To begin, point your OpenAI SDK or HTTP client to our base URL: https://api.unrestrictedaichat.top/v1. You need an API key, which you obtain by signing up via Google or email on the Get API key page. Pass this key in the Authorization header as a Bearer token. If the key is invalid, the API returns a 401 error. If your prepaid credit is exhausted, it returns a 402 error. There are no monthly subscriptions; credit is charged per token and never expires.

The Chat Completions Endpoint

Send text prompts using the standard POST /v1/chat/completions endpoint. The model ID is always uncensored. This endpoint accepts messages and returns generated text. It does not support embeddings, images, or audio. Below is a basic cURL example to get started. You can adjust parameters like temperature or top_p to control creativity.

curl https://api.unrestrictedaichat.top/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'

If you prefer Python, use the official openai package. Initialize the client with your key and the correct base URL. This approach works for most simple text generation tasks without requiring complex setup.

from openai import OpenAI

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

Streaming Responses (SSE)

For better user experience, enable streaming by setting stream: true. The API returns a Server-Sent Events (SSE) stream. Each chunk contains partial text. The final chunk includes the token usage statistics. This is ideal for real-time chat interfaces. Node.js developers can handle this stream efficiently using the official SDK or fetch API.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.unrestrictedaichat.top/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 reduces perceived latency but increases network overhead. Use it when immediate feedback is critical. Otherwise, non-streaming responses are simpler and more efficient for batch processing.

Function Calling & Tools

The API supports function calling (tools). Define your tools in the request and the model will return structured JSON when appropriate. Use tool_choice to force specific behavior. This is useful for building agents or extracting structured data from text. Note that function calling is not available in all modes; ensure your client library supports it. Check the OpenAI documentation for tool schema details, as we follow their standard.

JSON Mode

Enforce strict JSON output by setting response_format to {"type": "json_object"}. The model will attempt to return valid JSON without markdown wrappers. This is reliable for parsing responses in backend services. However, complex JSON structures may still occasionally fail validation. Always validate the output in your code. This feature is distinct from function calling and is simpler for basic data extraction.

Rate Limits & Constraints

Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. The context window is 100,000 tokens, with no separate output cap. If you exceed limits, you receive a 429 error. Errors during processing do not consume credit. Refusals for minor content violations are also free. Plan your concurrency accordingly to avoid throttling.

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)

Technical reference

If your tool speaks the OpenAI API, these are the details that matter.

SpecValue
ProtocolOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
Base URLhttps://api.unrestrictedaichat.top/v1
EndpointsPOST /v1/chat/completions · GET /v1/models
AuthenticationAuthorization: Bearer YOUR_KEY
Model IDuncensored
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Max outputup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
SSE streamingYes — server-sent events; the last chunk carries token usage
Max context100,000 tokens (prompt + completion together)
Structured outputJSON object mode via response_format json_object
Max body8 MB request body
Concurrency8 requests at the same time per key
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Rate limit300 requests per minute per key
How you payprepaid credit, charged by real token usage; errors and refusals are free
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Credit expiryno monthly fee; paid credit does not expire
Paymentcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Token pricesinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Trial credit$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Content policyadult content allowed; sexual content involving minors is refused
Accountsign in with Google or with e-mail + password
Key managementone active key per account; a new key replaces the old one

Error reference

Errors come back as JSON with a stable type; failed and refused requests are not billed.

HTTPTypeWhat to do
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largebody over 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busymodel busy — retry in a few seconds

Questions and answers

How do I top up my credit?

You can top up using USDT (TRC20) or USDC (Base). Payments range from $20 to $500. You receive a 5% bonus for $50+ and a 10% bonus for $100+. Credit never expires.

Is the model trained on my prompts?

No. We do not use your prompts for training. Your data remains private and is only used to generate the immediate response. We do not track your usage for model improvement.

What happens if I get a 402 error?

A 402 error means your prepaid credit is exhausted. You need to add more crypto credit to your account. Existing credit does not expire, so you can top up at your convenience.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.