Authentication: Using Your API Key
Send your API key in the Authorization header to prove your identity. We issue one key per account immediately after signup via Google or email. Keep this key secure because it controls your prepaid credit. Errors and refusals do not consume tokens, so your balance stays intact when the model declines a request. The base URL for all requests is https://api.unlimitedaitokens.com/v1. You can verify your key works by calling the models endpoint.
curl https://api.unlimitedaitokens.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Fetch last commit hash from remote repo"}]
}'
Chat Completions Endpoint
Use the POST /v1/chat/completions endpoint to generate text responses. Pass your messages in the standard format and specify the model ID as uncensored. This endpoint handles text input and returns text output. It does not support embeddings, images, or audio. The model runs on our own tuned open-weight infrastructure, not a proxy to GPT or Claude. Set the max_tokens parameter to control output length. The default output limit is 2,048 tokens if you do not set this value explicitly.
Streaming Responses (SSE)
Enable streaming by setting stream to true. The server returns Server-Sent Events (SSE) chunks as the model generates text. This reduces perceived latency for long responses. You can track token usage from the last chunk in the stream. Streaming works with all standard parameters like temperature and top_p. It is ideal for real-time chat interfaces or progressive rendering. The final chunk contains the complete token count for the request.
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)
Function Calling & JSON Mode
Structure your output using response_format set to json_object. This forces the model to return valid JSON instead of free-form text. You can also define tools in the tools array for function calling. The model will respond with tool calls if the input requires external actions. Use tool_choice to control whether the model must call a function. This feature works reliably with the uncensored model for structured data extraction. It supports standard OpenAI tool definitions for easy integration.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unlimitedaitokens.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);
Rate Limits & Quotas
We enforce strict limits to ensure stability for all users. Each key allows 300 requests per minute. You can run 8 concurrent requests at the same time. The maximum request body size is 8 MB. If you exceed these limits, the server returns a 429 Too Many Requests error. These limits are per key, so rotating keys can increase throughput. Paid credit never expires, and errors are free. You can top up with crypto to keep your projects running smoothly.
Error Handling
Handle errors by checking the HTTP status code and the error object in the response. A 401 Unauthorized error means your API key is invalid or missing. A 402 Payment Required error indicates your prepaid credit is exhausted. A 429 Too Many Requests error signals that you have hit the rate limit. These errors do not consume tokens from your balance. You can manage your account and request refunds for mistakes via the Support page. The model always refuses content involving minors, regardless of other settings.
from openai import OpenAI
client = OpenAI(base_url="https://api.unlimitedaitokens.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)