Quickstart: Integrate The Uncensored Chat API
Integrate our uncensored AI models into your application with a single OpenAI-compatible API endpoint. You get immediate access to a dedicated large language model that does not refuse lawful adult content, starting with a $0.50 trial credit.
Authentication and Base URL
Connect your client to our infrastructure using your unique API key and our dedicated base URL. The endpoint structure mirrors standard OpenAI formats, allowing you to swap providers without changing your application logic. You retrieve this key instantly after signing up with Google or email on the Get API key page. No phone number is required for verification.
- Base URL: HTTPS://api.llmcheapapi.com/v1
- Header: Authorization: Bearer YOUR_API_KEY
Keep your key secure. If you lose it, generate a new one on your dashboard, which immediately invalidates the previous active key. Each account supports only one active key at a time.
Chat Completions Endpoint
Send text prompts to the uncensored model via a standard POST request to the chat completions endpoint. This endpoint accepts messages in the OpenAI format and returns generated text responses. You specify the model ID as "uncensored" to ensure consistent behavior across requests.
- Endpoint: POST /v1/chat/completions
- Model ID: "uncensored"
The model processes your input and returns a completion without corporate restrictions on lawful adult topics. Errors during processing do not consume your prepaid credits. You pay strictly for tokens consumed.
Streaming Responses (SSE)
Receive real-time token generation using Server-Sent Events (SSE) for lower latency in interactive applications. Set the stream parameter to true to receive chunks of text as they are generated. This approach reduces perceived wait times for users in roleplay or chat scenarios.
Each chunk contains partial text and metadata. The final chunk includes the total token usage for billing purposes. You can parse these events to update your UI incrementally without waiting for the full response.
Function Calling and Tools
Enable structured interactions by defining tools that the model can invoke during generation. Use the tools parameter to provide function definitions, and set tool_choice to automatic or a specific function name. The model returns tool calls in the response format, which you can execute in your backend.
This feature supports complex workflows where the API acts as a decision engine. You can pass the results back into subsequent requests to maintain context. Function calling works alongside standard text generation without extra costs.
JSON Mode Output
Force the model to return strictly valid JSON by setting response_format to json_object. This mode is ideal for parsing structured data from unstructured prompts. The model optimizes its output to adhere to JSON syntax rules, reducing parsing errors in your application.
Use this feature when integrating with databases or frontend components that require predictable data structures. You can define expected schemas in your prompt or rely on the model's training to infer the structure. Errors in JSON formatting are rare but do not incur charges if the request fails.
Parameters: Temperature and Top P
Control creativity and randomness using temperature and top_p parameters. Temperature adjusts the probability distribution of predicted tokens, with higher values producing more diverse outputs. Top_p filters tokens based on cumulative probability, ensuring diverse yet coherent text.
For roleplay or creative writing, set temperature higher for variety. For deterministic tasks, use lower values. You can also set seed for reproducible results. These parameters fine-tune the uncensored model's behavior without affecting pricing. Pay attention to token limits when generating long outputs.
cURL
curl https://api.llmcheapapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate a summary of the latest Rust update notes"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.llmcheapapi.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.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.llmcheapapi.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
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)Common questions
How do I authenticate my API requests?
Include your API key in the Authorization header as a Bearer token. You can generate this key instantly on the Get API key page using Google or email. The key is shown immediately after signup and works with any OpenAI-compatible SDK.
What happens if I run out of credits?
You receive a 402 error indicating insufficient funds. You can top up using crypto (USDT on TRC20 or USDC on Base) from $20 to $500. Bonus credits are added automatically for larger amounts, and your existing credit never expires.
Does this API support streaming responses?
Yes, you can enable streaming by setting the stream parameter to true. You will receive Server-Sent Events containing partial text chunks. The final chunk includes the total token usage for billing, ensuring you only pay for what is actually generated.
Get your API key in minutes
Sign up, grab the key, and point your client to the new base URL. That is all.