Developer Documentation
Start generating text with our uncensored, OpenAI-compatible API in minutes. This guide covers authentication, SDK integration, and streaming for rapid development.
Base URL and Authentication
Your API key authenticates every request to our chat-completions endpoint. You receive this key immediately after signing up via Google or email on the Get API key page. No phone number is required. Store your key securely and pass it in the Authorization header.
Base URL: https://api.cheapllm.cc/v1. All requests must include this header: Authorization: Bearer YOUR_API_KEY. Errors like 401 indicate an invalid or missing key. Replace your old key anytime to generate a new one; only one active key exists per account.
First Request
Send your first prompt using the standard chat/completions endpoint. The model ID is uncensored. This open-weight model answers without content refusals for lawful adult use, including fictional or controversial topics. You get text in, text out. No embeddings or image generation here.
Below is a basic cURL example. Replace YOUR_API_KEY with your key. The request body defines the user message. We process 100,000 tokens context window (prompt + completion). Errors and refusals are free, so test freely.
- Set
modeltouncensored. - Include
messagesarray. - Add your API key header.
curl https://api.cheapllm.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Set timezone to UTC for all logs"}]
}'
Python SDK Integration
Use the official OpenAI Python SDK to interact with our API. Set the base URL to our endpoint and provide your key. This approach works with any OpenAI-compatible client library. Configure parameters like temperature and top_p as needed. Streaming is supported via Server-Sent Events (SSE). This method is ideal for real-time applications where you want to display tokens as they generate.
Install the library with pip install openai. Initialize the client with our base URL. The code below shows a simple completion request. Adjust the message content to fit your use case. Our API handles the routing to the correct model internally.
from openai import OpenAI
client = OpenAI(base_url="https://api.cheapllm.cc/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 Integration
For Node.js developers, the OpenAI npm package works seamlessly. Set the base URL to our API endpoint. This allows you to use familiar patterns from other providers. Configure the model ID to uncensored. You can also enable JSON mode or function calling if your application requires structured output. The SDK handles authentication automatically when configured correctly.
Install the package with npm install openaimax_tokens to control output length. Errors are returned as standard HTTP status codes. Use this for quick prototyping or production integrations.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.cheapllm.cc/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 via SSE
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE). Each chunk contains partial text. The final chunk includes token usage statistics. This feature is crucial for user experience in chat interfaces. It reduces perceived latency significantly. You can parse the stream to display text in real-time.
Handle the stream events in your client code. Close the connection when the stream ends. Our API supports up to 8 concurrent requests per key. This limit ensures fair usage. Monitor your usage via the final chunk data. Errors during streaming still return appropriate status codes. Use this for roleplay or continuous conversation scenarios.
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)
Limits, Errors, and Context Window
Our API has strict limits to ensure stability. You can send 300 requests per minute per key. Concurrent requests are capped at 8. Request bodies cannot exceed 8 MB. The context window is 100,000 tokens total. Max output is 16,000 tokens per request (2,048 if max_tokens is unset). Errors return specific codes: 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Credit never expires. Mistakes like double charges are fixed via Support. Privacy is maintained; prompts are not used for training. No sexual content involving minors is allowed.
Frequently asked questions
Is this a cheap LLM API for production use?
Yes, it is designed for low-cost, unrestricted text generation. You pay per token with no monthly fees. Credit never expires, so you can scale usage up or down instantly. This is ideal for startups needing reliable supply without vendor lock-in.
How do I handle errors in my application?
The API returns standard HTTP status codes. A 401 error means your API key is invalid or missing. A 402 error indicates insufficient prepaid credit. A 429 error signals you have exceeded the rate limit of 300 requests per minute. Check your key and balance first.
Can I use this for roleplay or uncensored content?
The model is uncensored and does not refuse lawful adult, fictional, or controversial topics. It is not GPT, Claude, or any other vendor's model. It is an open-weight model tuned for unrestricted responses. Just avoid sexual content involving minors, which is always refused.
Access your API key
Register, retrieve your token, and update your endpoint URL. That is all you need to do.