API Documentation: Quickstart Guide
Get started with the Heretic AI API in minutes. This guide covers the OpenAI-compatible endpoints, authentication, and key parameters for uncensored text generation.
Base URL and Authentication
The Heretic AI API is fully OpenAI-compatible. You interact with it by pointing your client to our base URL: https://api.hereticai.cc/v1. Authentication relies on a single API key per account, generated instantly upon signup via Google or email. Pass this key in the Authorization header as a Bearer token. The model identifier is simply uncensored. This single model handles all your requests without routing complexity. Errors like 401 indicate an invalid key, while 402 means you need more prepaid crypto credit.
curl https://api.hereticai.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "generate twenty test cases"}]
}'
Chat Completions Endpoint
Send text requests using the POST /v1/chat/completions endpoint. The API expects a standard messages array containing your conversation history or prompt. It returns generated text in the choices array. This is a pure utility API: text in, text out. You pay only for tokens consumed. Prepaid credit never expires, and refusals or errors do not cost tokens. This approach eliminates subscription locks and unpredictable free tiers.
from openai import OpenAI
client = OpenAI(base_url="https://api.hereticai.cc/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 (SSE)
Enable real-time token streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) for each generated token. This allows you to display output progressively, which is crucial for latency-sensitive applications. Token usage statistics appear in the final chunk of the stream. This feature works seamlessly with standard OpenAI SDKs that handle SSE automatically. It provides immediate feedback without 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)
Function Calling and Tools
The API supports function calling with the tools and tool_choice parameters. Define your tool schemas in the request, and the model will return structured function calls when appropriate. This enables complex workflows where the LLM decides which action to take next. You can enforce specific tool usage or let the model choose freely. This capability is essential for building agentic applications that interact with external systems or databases.
JSON Mode
Ensure deterministic output by setting response_format to {"type": "json_object"}. The model will constrain its response to valid JSON, which is vital for programmatic parsing. This reduces the need for post-processing regex fixes. It guarantees that the output can be directly consumed by your code. This is particularly useful for structured data extraction or configuration generation tasks.
Parameters and Limits
Control generation with standard parameters like temperature, top_p, and seed. The context window is 100,000 tokens for prompt plus completion. Max output is 16,000 tokens per request, or 2,048 if max_tokens is unset. Rate limits are 300 requests per minute and 8 concurrent requests per key. The request body must stay under 8 MB. These limits ensure stable high-volume usage for developers.
Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.hereticai.cc/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);FAQ
What is Heretic AI?
Heretic AI is an uncensored LLM API that serves a single large language model tuned for lawful adult use without content refusals. It is an open-weight model run on our servers, distinct from GPT, Claude, or other vendor models. It offers a straightforward, pay-per-token experience via an OpenAI-compatible interface.
How do I pay for the API?
You top up prepaid credit using crypto: USDT (TRC20) or USDC (Base). Minimum top-ups are $20, with bonus credit starting at $50. Credit never expires, and you pay only for tokens used. Errors and refusals are free, so you only spend on actual consumption.
Is the API uncensored?
Yes, the model does not refuse lawful adult, fictional, or controversial topics. It only blocks sexual content involving minors. This makes it ideal for developers needing unrestricted text generation without the unpredictability of free tiers or subscription locks.
Generate your key
Sign up, retrieve the key, update base URL. Done.