Unhinged AI API Quickstart
Get started with the Unhinged AI uncensored LLM API in minutes. Send text, get raw outputs, and pay only for the tokens you actually use with our transparent prepaid model.
Base URL & Authentication
Start by pointing your OpenAI-compatible client at https://api.unhingedai.top/v1. The API key is generated immediately after signup via Google or email. Include it in the Authorization header as a bearer token. This single key authenticates all requests to the uncensored API. If you generate a new key, the previous one is invalidated. Keep your key secure; it grants access to your prepaid credit.
First Request
Send a standard chat-completions request to generate text. The model ID is always uncensored. You can control creativity with temperature and top_p. Requests are charged per token consumed. Errors and refusals do not deduct credit. This endpoint is the core of the uncensored AI API experience.
curl https://api.unhingedai.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'This returns a direct text response from the open-weight model, free from typical corporate filters.
Python SDK Integration
Use the official openai Python library for easy integration. Set the base URL to our endpoint and provide your API key. The SDK handles JSON serialization and streaming automatically. This is ideal for bots, scripts, and backend services needing raw text generation. The uncensored LLM API works seamlessly with standard OpenAI SDK patterns.
from openai import OpenAI
client = OpenAI(base_url="https://api.unhingedai.top/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)Install the library via pip and configure the client with your credentials to start generating content immediately.
Node.js SDK Usage
For JavaScript environments, use the openai npm package. Configure the base URL and API key just like in Python. Node.js is perfect for web servers and real-time applications. The SDK supports both synchronous and asynchronous request handling. This ensures your Node applications can leverage the uncensored models API without custom HTTP logic.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unhingedai.top/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);Import the client, set the configuration, and call chat.completions.create() to receive text outputs.
Streaming Responses
Enable streaming by setting stream: true in your request. The API returns data incrementally via Server-Sent Events (SSE). Token usage statistics are included in the final chunk. This reduces perceived latency for end-users. Streaming is essential for chat interfaces and real-time bot responses. It provides a smoother experience than waiting for the full completion.
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)Parse the SSE stream to display tokens as they are generated. This keeps the interface responsive and engaging.
Rate Limits & Errors
Each key is limited to 300 requests per minute and 8 concurrent requests. The request body must not exceed 8 MB. A 401 error means your API key is invalid. A 402 error indicates your prepaid credit is exhausted; top up by crypto (USDT on TRC20, USDC on Base) to continue. A 429 error signals you have exceeded the rate limit. Wait briefly before retrying. The context window is 100,000 tokens total. Errors do not consume credit.
JSON Mode & Function Calling
Force structured output by setting response_format to {"type": "json_object"}. The model will return valid JSON instead of free-form text. This is useful for parsing data or driving applications. Function calling is also supported via the tools parameter. Pass tool definitions and let the model choose which function to invoke. This enables complex agent workflows without external parsing logic. Combine JSON mode with streaming for reliable structured data delivery.
Technical specifications
Use this table to decide whether the API fits your project before you buy credit.
| Item | Value |
|---|---|
| API format | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Model ID | uncensored |
| Methods | POST /v1/chat/completions · GET /v1/models |
| API key | Bearer token in the Authorization header |
| Base URL | https://api.unhingedai.top/v1 |
| Context window | 100,000 tokens, input and output combined |
| Other parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Streaming | Supported (stream: true), usage included at the end |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Completion length | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| JSON mode | response_format: {"type": "json_object"} |
| Parallel requests | 8 requests at the same time per key |
| Request size | 8 MB request body |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Requests per minute | 300 requests per minute per key |
| Token prices | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Free trial | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Subscription | no monthly fee; paid credit does not expire |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Bonus credit | +5% on $50+, +10% on $100+, +15% on $200+ |
| Account | Google or e-mail and password |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
| Key management | one active key per account; a new key replaces the old one |
When a request fails
Every error is JSON with a type you can switch on. You are never charged for an error.
| Status | Type | Reason |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | sexual content involving minors — refused, not billed |
404 | not_found | unknown endpoint |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | temporary overload, retry shortly |
Questions and answers
Is the trial credit reusable?
No. New users get $0.50 of trial credit, one per person, valid for 7 days. This is a one-time offer per person and cannot be reinstated after expiration. Claim this credit with one click on your API key page.
How do I top up my credit?
Top up is available by crypto (USDT on TRC20, USDC on Base). Minimum top-up is $20, and maximum is $500. Bonus credit is applied automatically for larger amounts.
Does the model refuse adult content?
Yes, but only for lawful adult content. The model does not refuse controversial, fictional, or adult topics. The only hard limit is content involving minors, which is always blocked.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.