- Unlocked AI Models
- API Documentation
API Documentation
This documentation covers the core chat-completions interface for our uncensored model. Use the provided endpoints to send text and receive unrestricted responses immediately.
Authentication and Base URL
Send your requests to our base URL with a valid API key in the header.
- Base URL:
https://api.unlockedaimodels.com/v1 - Header:
Authorization: Bearer YOUR_API_KEY
The model identifier is simply uncensored. You get one active key per account, which replaces any previous key upon generation.
curl https://api.unlockedaimodels.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate the standard HTTP headers for a POST request."}]
}'
Chat Completions Endpoint
The POST /v1/chat/completions endpoint processes your text and returns a completion.
This is the only text endpoint we provide. We do not offer image, audio, or embedding generation. The model accepts a standard messages array containing your system, user, and assistant turns.
Errors like 401 indicate an invalid key, while 402 means you need more credit. Requests are charged only when tokens are generated.
Streaming Responses (SSE)
Enable streaming by setting stream: true in your request body.
Each chunk contains partial text, allowing you to display output in real-time. The final chunk includes the full token usage statistics for billing transparency.
This method reduces perceived latency for long responses, which is critical when generating over 16,000 tokens.
from openai import OpenAI
client = OpenAI(base_url="https://api.unlockedaimodels.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)
Function Calling and Tools
Define tools in your request to enable structured function calling.
The model supports tool_choice parameters, allowing you to force specific behaviors or let the model decide. This is useful for building agents that need to interact with external systems without breaking the uncensored context.
Ensure your tool definitions follow the OpenAI schema for compatibility.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unlockedaimodels.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);
JSON Mode and Structured Outputs
Force the model to return valid JSON by setting response_format: {"type": "json_object"}.
This ensures predictable parsing for your applications. Use this mode when extracting data or generating configuration files.
Combined with function calling, it creates a robust pipeline for automated tasks without external validation layers.
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)
Parameters: Temperature, Top-P, and Stop
Control creativity with temperature and diversity with top_p.
Use stop sequences to halt generation at specific markers. The context window is 100,000 tokens total, with a max output of 16,000 tokens unless you specify a lower max_tokens value (default is 2,048).
Rate limits are 300 requests per minute and 8 concurrent requests per key.
FAQ
How do I get started with the uncensored model?
Sign up with Google or email to receive a free $0.50 trial. Add crypto credit to continue using the API after the trial expires. Use the provided base URL and your API key to make your first request.
What happens if I hit the rate limit?
You will receive a 429 error. The limit is 300 requests per minute and 8 concurrent requests per key. Wait a moment and retry, or reduce the number of parallel requests.
Is the uncensored model free?
No, but you get $0.50 in trial credit. After that, you pay per token. Input tokens cost $0.15 per million, and output tokens cost $0.50 per million. Errors and refusals are free.
Get your API key now
Sign up, copy the key, and update the base URL. That is all you need.