Uncensored AI/API Documentation
API Documentation
Start sending requests to the uncensored AI GitHub API in minutes using standard OpenAI-compatible clients. This guide covers authentication, code samples, and the specific limits that keep your integration stable.
https://api.uncensoredaigithub.com/v1uncensored
Authentication and Base URL
The API requires a bearer token for every request. Generate your key on the Get API key page by signing in with Google or an email password. The key appears immediately without phone verification. Use the base URL https://api.uncensoredaigithub.com/v1 with the official OpenAI SDKs by updating the base_url and api_key values. This setup works with any OpenAI-compatible client.
Endpoint: https://api.uncensoredaigithub.com/v1
Auth Header: Authorization: Bearer YOUR_API_KEY
Each account supports one active key. Issuing a new key automatically invalidates the previous one. This prevents token drift when you rotate credentials across different environments.
Chat Completions Endpoint
Send text requests to the /v1/chat/completions endpoint using the model ID uncensored. The API accepts standard chat messages and returns text responses without content filters for lawful adult use. You can configure parameters like temperature, top_p, and stop to control creativity and output length.
The context window allows up to 100,000 tokens for the combined prompt and completion. Set max_tokens to control output, with a default of 2,048 tokens if omitted. Errors and refusals do not consume credit, so you can test safely.
Streaming Responses and Usage
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) containing partial text chunks. Token usage data appears only in the final chunk of the stream. This allows real-time rendering of responses while accurately tracking consumption.
Streaming is ideal for roleplay applications or long-form content generation. You can parse the SSE stream to update the UI incrementally. The API ensures that usage metrics remain accurate even if the connection drops prematurely.
Function Calling and Tools
Support function calling by providing a tools array in the request. The model can return structured tool calls with arguments. Use tool_choice to enforce specific behaviors, such as automatic function execution. This feature enables integration with external services or custom logic.
Define functions with names, descriptions, and parameter schemas. The API returns the function name and arguments in the response. Parse these arguments to execute your custom code. This capability makes the uncensored LLM API suitable for complex agent workflows.
JSON Mode and Parameters
Force structured output by setting response_format to {"type": "json_object"}. The model will return valid JSON instead of plain text. This is useful for data extraction or configuration generation. Combine this with function calling for robust API integrations.
Other supported parameters include seed for deterministic outputs, presence_penalty, and frequency_penalty. Use seed to reproduce specific responses for debugging. Adjust penalties to reduce repetition or encourage diverse vocabulary in your outputs.
Error Handling and Limits
The API enforces a rate limit of 300 requests per minute and 8 concurrent requests per key. Request bodies must not exceed 8 MB. If you exceed these limits, you receive a 429 status code. Authentication failures return a 401 error. Insufficient credit triggers a 402 error.
Credit is charged based on real token usage. Prepaid credit never expires, so you do not need to worry about monthly renewals. Use the Support page to resolve issues like double charges.
cURL
curl https://api.uncensoredaigithub.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Run the unit tests for the new auth module."}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredaigithub.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.uncensoredaigithub.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)Frequently asked questions
What is the uncensored AI GitHub API?
It is a hosted, OpenAI-compatible chat-completions API serving one uncensored large language model. The model is tuned to answer without content refusals for lawful adult use. It is an open-weight model run on our own servers.
How do I pay for the uncensored AI API?
Payments are crypto-only via USDT (TRC20) or USDC (Base). You can top up any whole amount from $20 to $500. Bonus credit applies for larger deposits: +5% from $50, +10% from $100, and +15% from $200.
What are the limits for the uncensored AI model?
The context window is 100,000 tokens, with a max output of 16,000 tokens per request. You are limited to 300 requests per minute and 8 concurrent requests per key. Request bodies must stay under 8 MB.
Access requires one step
Sign up, retrieve your token, and update your base URL. That covers the entire configuration.