API Documentation
Start generating uncensored content immediately with our OpenAI-compatible API. This guide covers the essential endpoints, authentication, and streaming capabilities for your integration.
https://api.unlimitedtokensai.com/v1
Base URL and Authentication
Your requests target the dedicated uncensored model endpoint. All interactions use the standard chat-completions structure. You must include your API key in the header for every call. The base URL is https://api.unlimitedtokensai.com/v1.
Authentication relies on a single bearer token. Generate your key via the dashboard using Google or email. Each account holds one active key at a time. Replace the old key when you generate a new one. Errors and refusals do not consume your prepaid credit. This ensures you only pay for actual token usage.
First Request
Send a simple prompt to verify your connection and model responsiveness. The system accepts standard JSON payloads for text generation. This initial test confirms your key validity and credit balance.
Replace YOUR_API_KEY with your actual credential. The model identifier is fixed at uncensored. You receive a direct text response in the usage statistics. This confirms the uncensored model is active and ready for your content.
curl https://api.unlimitedtokensai.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate a 200 token summary of the latest release notes"}]
}'
Python SDK Integration
Use the official OpenAI Python library for seamless integration. Set the base URL to our endpoint before initializing the client. This allows you to leverage existing SDK utilities like pagination. Pass your key directly to the client constructor. The library handles JSON serialization automatically.
Import the standard openai package. Configure the base URL to point to our infrastructure. Request completions using the uncensored model ID. This approach works with any OpenAI-compatible client library. It simplifies error handling and response parsing for your Python scripts.
from openai import OpenAI
client = OpenAI(base_url="https://api.unlimitedtokensai.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)
Node SDK Usage
Integrate quickly using the JavaScript SDK for Node environments. Define the base URL in the configuration object. This ensures all requests route through our uncensored endpoint. The SDK manages the HTTP connections efficiently. You can stream responses or receive full text blocks.
Install the openai package via npm. Set the baseURL to our API domain. Pass your API key in the initialization options. The client behaves identically to the standard OpenAI client. This compatibility reduces migration time for your existing applications.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unlimitedtokensai.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
Enable streaming to receive partial results as they generate. Set the stream parameter to true in your request. The API returns chunks via Server-Sent Events (SSE). Each chunk contains partial text and usage data. This reduces perceived latency for long outputs. You can display tokens to users in real-time.
Listen for the content delta in each chunk. Aggregate these deltas to reconstruct the full message. The final chunk includes the complete token count. This method is ideal for chat interfaces. It provides immediate feedback while the model computes. Streaming works with both Python and Node SDKs.
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 Errors
Your key supports 300 requests per minute concurrently. You can run up to 8 simultaneous requests per key. The request body limit is 8 MB. Exceeding these limits returns a 429 error. Check the retry-after header for resumption timing. Authentication failures return a 401 status code. Insufficient credit triggers a 402 error.
The context window spans 100,000 tokens total. This includes both prompt and completion. Max output is 16,000 tokens per request. Set max_tokens explicitly to control length. Errors during generation do not charge your credit. This structure protects your prepaid balance from wasted compute. Monitor your usage via the dashboard.
Frequently asked questions
Does unlimitedtokens AI support function calling?
Yes, the API supports function calling with tools and tool_choice parameters. You can define custom tools in your request payload. The model responds with structured JSON arguments for your functions. This enables complex agent workflows without extra configuration.
How does the uncensored LLM handle context length?
The model supports a 100,000 token context window for prompt and completion combined. You can request up to 16,000 tokens in a single output. If you omit max_tokens, the default limit is 2,048 tokens. This allows for extensive conversational history or large document processing.
What happens if I exceed the rate limit?
You will receive a 429 Too Many Requests error. You can retry after the specified retry-after period. The limit is 300 requests per minute per key. Concurrent requests are capped at 8. Adjust your client logic to handle retries gracefully.
Get your key in a single step
Sign up, copy the key, and update your base URL. That’s all you need to start.