API Documentation
Get your uncensored AI chat running in minutes with a standard OpenAI-compatible endpoint. No model routing, no monthly fees—just prepaid tokens for unrestricted text generation.
Quickstart: Make Your First Request
Your API key authenticates every call to our base URL. Use the standard /v1/chat/completions endpoint with the model ID uncensored to generate text. This works with any OpenAI SDK by simply updating the base URL configuration.
Send a JSON payload with your prompt and receive a direct response. There are no hidden fees, only token usage. Errors like content refusals (except for the hard minor limit) do not charge credit.
Authentication and Keys
Generate your key via the dashboard using Google or email. Keys are single-use per account; creating a new one invalidates the previous key immediately. Keep your key secure as it draws from your prepaid balance.
Include the key in the Authorization header. We do not support multiple keys per account, ensuring simple usage tracking without complex billing overhead.
Request Parameters and Options
Configure generation behavior using standard parameters like temperature, top_p, and stop. You can enforce strict JSON output with response_format or define tools for function calling. The model accepts up to 100,000 tokens for prompt and completion combined.
Set max_tokens to control output length. Default is 2,048 tokens. You can adjust presence_penalty and frequency_penalty to refine repetition and topic adherence without external moderation layers.
Streaming Responses and Usage
Enable streaming by setting stream: true. You receive Server-Sent Events (SSE) chunks as tokens are generated. The final chunk contains the total token usage for the request, allowing you to track costs in real-time.
This is ideal for UIs that display text as it generates. You can cancel the stream early without losing the tokens already processed, which are charged to your account.
Error Handling and Limits
Handle HTTP 401 errors by verifying your API key. HTTP 402 indicates insufficient prepaid credit; top up via crypto to resume. HTTP 429 means you hit the rate limit of 300 requests per minute or 8 concurrent connections per key.
Request bodies are capped at 8 MB. If you exceed the 100,000 token context window, the API returns an error. Errors do not consume credit, so you can test freely without risk.
Supported SDKs and Code Examples
Use the official OpenAI SDKs for Python, Node.js, or cURL. Set the base URL to our API endpoint. Pass your API key in the headers. The model ID is always uncensored.
Code samples are provided below for each language. They demonstrate basic completion and streaming. Adapt the parameters to your specific use case, from roleplay to structured data extraction.
cURL
curl https://api.unhingedaichat.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Set the temperature to 0.7"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.unhingedaichat.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.unhingedaichat.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 get started with unhinged AI chat?
Sign up with Google or email to get your API key instantly. Top up with crypto to get started. Use the key with the base URL and model ID <code>uncensored</code> to make your first request.
Does the uncensored LLM support streaming?
Yes, set <code>stream: true</code> to receive token-by-token updates via SSE. The final chunk includes usage data. This is supported by all standard OpenAI-compatible SDKs.
What happens if I hit a rate limit?
You receive an HTTP 429 error. The limit is 300 requests per minute per key. You can wait or reduce concurrent connections. Errors do not charge your prepaid credit.
Secure your API key
Register, retrieve the key, update the endpoint. Simple integration.