GitHub Uncensored AI API Reference
Integrate the uncensored LLM into your applications with a standard OpenAI-compatible endpoint. You get immediate text generation without content filters, prepaid crypto billing, and a 100,000-token context window.
Authentication & Base URL
The API requires a bearer token for every request. You generate this key instantly via the dashboard using Google or email credentials. Once created, the key authenticates your prepaid account against the hosted model.
Set your base URL to point directly to our API gateway. This ensures all requests route to the correct uncensored model server.
Use the standard Authorization header with the Bearer scheme. Replace the placeholder with your unique key string.
Base Configuration
- Base URL:
https://api.githubuncensoredai.com/v1 - Auth Header:
Authorization: Bearer YOUR_API_KEY - Model ID:
uncensored
curl https://api.githubuncensoredai.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Fix the syntax error in this python loop"}]
}'
Chat Completions Endpoint
Send text data to the chat completions endpoint and receive generated text in response. The system accepts a list of messages with roles like user or assistant. It returns a completion based on the prompt history.
This endpoint handles standard conversation flows. You can send multiple turns, and the model maintains context up to the limit. It does not support images, audio, or video inputs. The response format is standard JSON.
Ensure your payload includes the model identifier. The system ignores unknown fields gracefully. Errors return specific codes if authentication fails or credits run out.
from openai import OpenAI
client = OpenAI(base_url="https://api.githubuncensoredai.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)
Streaming Responses
Enable streaming by setting the stream flag to true. The API returns a series of Server-Sent Events instead of a single JSON object. Each event contains a chunk of the generated text.
This approach reduces perceived latency for long responses. You can start displaying text to users as it is generated. The final chunk includes the token usage statistics for billing.
Handle the stream efficiently in your client code. Close the connection when the stream ends or an error occurs. This method works well for real-time chat interfaces.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.githubuncensoredai.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);
Function Calling & JSON Mode
The model supports structured output via function calling. Define tools in your request with names, descriptions, and parameter schemas. The model selects the appropriate tool and generates arguments.
Use JSON mode for strict schema compliance. Set the response format to json_object to force valid JSON output. This is useful for parsing data or generating code snippets.
Combine function calling with streaming for interactive experiences. The model can invoke multiple tools in sequence. Validate the output schema before executing functions in your application logic.
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 & Limits
Control generation behavior with parameters like temperature and top_p. Adjust these values to balance creativity and determinism. The default settings work for most general purposes.
Respect the request limits to avoid errors. You can send up to 300 requests per minute per key. Concurrent requests are capped at eight per key. The maximum request body size is 8 MB.
The context window spans 100,000 tokens. This includes both prompt and completion tokens. Output is limited to 16,000 tokens per request. Exceeding these limits returns an error code.
Token Usage & Billing
Billing is prepaid and based on actual token usage. Input tokens cost $0.15 per million, and output tokens cost $0.50 per million. Errors and refusals do not consume credits.
Credit never expires. Top-ups are processed via crypto only. You receive bonus credit for larger deposits. The system tracks usage accurately for each API key.
Monitor your balance through the dashboard. If credits run low, your requests will fail with a specific error code. Add funds instantly to resume service without waiting for approvals.
Common questions
How do I handle authentication errors?
If you receive a 401 error, your API key is invalid or expired. Check your dashboard to ensure the key is active. Regenerate the key if necessary. Ensure you are using the correct base URL and header format.
What happens if I run out of credits?
Requests will fail with a 402 error indicating insufficient funds. No tokens are charged for these failed attempts. Top up your crypto balance to resume service immediately. Credits do not expire, so you can add funds whenever convenient.
Is the API rate-limited?
Yes, you are limited to 300 requests per minute and 8 concurrent requests per key. Exceeding these limits returns a 429 error. Use streaming to reduce the number of requests for long responses. Monitor your usage to avoid throttling.
Generate your key in seconds
Sign up, grab your key, update your base URL. Done.