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.
| Spec | Value |
|---|---|
| Protocol | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Base URL | https://api.unrestrictedaichat.top/v1 |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Authentication | Authorization: Bearer YOUR_KEY |
| Model ID | uncensored |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Max output | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| Max context | 100,000 tokens (prompt + completion together) |
| Structured output | JSON object mode via response_format json_object |
| Max body | 8 MB request body |
| Concurrency | 8 requests at the same time per key |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Rate limit | 300 requests per minute per key |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Bonus credit | +5% on $50+, +10% on $100+, +15% on $200+ |
| Credit expiry | no monthly fee; paid credit does not expire |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Token prices | input $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 policy | adult content allowed; sexual content involving minors is refused |
| Account | sign in with Google or with e-mail + password |
| Key management | one 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.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | model 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.