Heretic LLMHeretic LLM: How to Use It Through an API
Heretic LLM: How to Use It Through an API
If you want to know heretic llm how to use, the short answer is that it is a hosted, OpenAI-compatible API. You keep the client you already have and change two values: the base URL and the API key.

Key points
- Base URL is https://api.hereticllm.com/v1 and the model ID is uncensored.
- Any OpenAI SDK works: Python, Node, curl, or an app with a custom endpoint field.
- Streaming, tool calling and JSON mode are supported, with a 100,000 token context window.
- New users can claim $0.50 of trial credit, no card needed, then top up from $20.
What you need to change in your client
Heretic LLM exposes the same request format as the OpenAI chat API. That means there is nothing new to learn on the client side. If your code already calls chat.completions.create, you point it at a different address, send a different key, and ask for a different model name. Everything else in your request, from the messages array to the sampling parameters, keeps its meaning.
| Setting | Value |
|---|---|
| Base URL | https://api.hereticllm.com/v1 |
| Model ID | uncensored |
| Auth header | Authorization: Bearer YOUR_KEY |
| Chat endpoint | POST /v1/chat/completions |
| Model list | GET /v1/models |
Two things are worth knowing before you write code. First, there is one model behind the API, an open-weight model run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not the official API of any big vendor and it is not a router that picks between vendors, so there is no model picker to configure. Second, the service is text only. There is no image, audio or video generation, no embeddings and no fine-tuning, so the two endpoints above are the whole surface.
The one hard limit is content involving minors. Sexual content involving minors is never allowed, and requests like that will not be served.
Get a key and the free trial credit
Open the API key page and sign up with Google, or with an email and password. After sign-up the key page shows your key and a button to claim $0.50 of trial credit. It takes one click, needs no card, is valid for 7 days, and is limited to one claim per person. That is enough to run the examples below many times over, since a short chat reply costs a fraction of a cent.
Trial keys have lower limits than full keys: 2 concurrent requests and 60 requests per minute, against 8 concurrent and 300 per minute on a full key. A full key comes from topping up. Top-ups are any whole amount from $20 to $500, with a bonus of 5% from $50, 10% from $100 and 15% from $200. You can pay with crypto (USDT on TRC20, USDC on Base). Credit is prepaid, there is no subscription, and it never expires. The pricing page has the full table.
Store the key in an environment variable rather than in source code. The examples here read it from HERETIC_API_KEY:
export HERETIC_API_KEY="paste-your-key-here"
export HERETIC_BASE_URL="https://api.hereticllm.com/v1"
# model: uncensoredYour first request with curl
curl is the quickest way to confirm that the key and URL are right, because it removes every library from the picture. The request below sends a system message and a user message and asks for a moderate temperature.
curl https://api.hereticllm.com/v1/chat/completions \
-H "Authorization: Bearer $HERETIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [
{"role": "system", "content": "You are a concise technical assistant."},
{"role": "user", "content": "Explain what a context window is in two sentences."}
],
"temperature": 0.7
}'A good response is a JSON object with a choices array and a usage block. The reply text is at choices[0].message.content. Add -i to the command to see the response headers. You will find X-Request-Id, which is useful if you ever contact support about a specific call, and X-Balance-USD, which shows your remaining credit after the request. The rate limit headers X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency tell you which tier your key is on.
You can also list models. The answer is a single entry, and it is the ID you put in the model field:
curl https://api.hereticllm.com/v1/models \
-H "Authorization: Bearer $HERETIC_API_KEY"
# model id to use in requests: uncensoredIf you get a 401, the key is missing or mistyped, or the header does not start with the word Bearer followed by a space. If you get a 404, check that the URL ends in /v1 in your client and that the path is not doubled, for example /v1/v1/chat/completions.
Python and Node with the official OpenAI SDKs
For Python, install the openai package and construct the client with a custom base_url. Nothing else changes.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.hereticllm.com/v1",
api_key=os.environ["HERETIC_API_KEY"],
)
resp = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You are a concise technical assistant."},
{"role": "user", "content": "Explain what a context window is in two sentences."},
],
temperature=0.7,
)
print(resp.choices[0].message.content)
print(resp.usage.prompt_tokens, resp.usage.completion_tokens)The usage object gives you the prompt and completion token counts for the call. Since billing is per token, logging those two numbers per request is the easiest way to see what your app costs.
In Node, install openai from npm and use the baseURL option. The example uses an ES module with top-level await, so save it as .mjs or set "type": "module" in package.json.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.hereticllm.com/v1",
apiKey: process.env.HERETIC_API_KEY,
});
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [
{ role: "system", content: "You are a concise technical assistant." },
{ role: "user", content: "Explain what a context window is in two sentences." },
],
});
console.log(resp.choices[0].message.content);The same two values work in frameworks built on top of these SDKs. LangChain, LlamaIndex and many chat front ends have a field for an OpenAI-compatible base URL, and SillyTavern lets you add an OpenAI-compatible endpoint as a custom source. Wherever the tool asks for an API base, paste the URL from the table above, paste your key, and type uncensored as the model name. If the tool insists on choosing from a list of known OpenAI models, look for a custom or advanced option instead.
Streaming responses
Set stream: true and the API sends server-sent events as the model writes. Your client prints tokens as they arrive instead of waiting for the full answer, which matters for chat interfaces and any answer longer than a few sentences. Usage information is delivered at the end of the stream.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.hereticllm.com/v1", api_key=os.environ["HERETIC_API_KEY"])
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Write a four-line poem about rain."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
print()The if chunk.choices guard is there because the last chunk can carry no choices. Without the check a loop that indexes into choices[0] would fail on that final event.
One detail affects capacity planning: a streamed request holds its concurrency slot until the stream ends. A full key allows 8 requests at once, so if each of your users keeps a stream open for 30 seconds, you can serve only 8 of them at the same moment. If a stream is abandoned in the browser but not closed on your server, it keeps counting. Close the connection when the user leaves, and your slots free up.
Tool calling and JSON mode
Both features follow the OpenAI format. For tool calling you describe functions in tools, optionally set tool_choice, and read tool_calls from the reply. Your code runs the function, then sends the result back as a message with role: "tool" and the matching tool_call_id. Streamed responses carry tool_calls as deltas too.
import json, os
from openai import OpenAI
client = OpenAI(base_url="https://api.hereticllm.com/v1", api_key=os.environ["HERETIC_API_KEY"])
tools = [{
"type": "function",
"function": {
"name": "get_order_status",
"description": "Look up the status of an order by its numeric id.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "integer"}},
"required": ["order_id"],
},
},
}]
def get_order_status(order_id):
return {"order_id": order_id, "status": "shipped"}
messages = [{"role": "user", "content": "Where is order 4812?"}]
first = client.chat.completions.create(
model="uncensored", messages=messages, tools=tools, tool_choice="auto"
)
msg = first.choices[0].message
if msg.tool_calls:
messages.append(msg)
for call in msg.tool_calls:
args = json.loads(call.function.arguments)
result = get_order_status(**args)
messages.append({
"role": "tool",
"tool_call_id": call.id,
"content": json.dumps(result),
})
final = client.chat.completions.create(
model="uncensored", messages=messages, tools=tools
)
print(final.choices[0].message.content)
else:
print(msg.content)Models make mistakes with arguments, so treat the parsed JSON as untrusted input. Validate types and ranges before you run anything with side effects, and return a plain error string as the tool result if validation fails. The model can usually correct itself on the next turn.
JSON mode
If you need machine-readable output without tool calls, pass response_format with {"type": "json_object"}. Also say in the prompt that you want JSON and describe the keys. The setting makes the output a valid object, and your instructions decide what is inside it.
import json, os
from openai import OpenAI
client = OpenAI(base_url="https://api.hereticllm.com/v1", api_key=os.environ["HERETIC_API_KEY"])
resp = client.chat.completions.create(
model="uncensored",
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": "Reply with a JSON object with keys title and tags."},
{"role": "user", "content": "Suggest metadata for a post about home networking."},
],
)
data = json.loads(resp.choices[0].message.content)
print(data["title"], data["tags"])Wrap json.loads in a try block anyway. If a reply hits max_tokens before the object closes, it will not parse, so leave max_tokens unset or generous for structured output.
Limits, errors and retries
The context window is 100,000 tokens, counting the prompt and the completion together. max_tokens is optional, and when you leave it out the completion can use whatever room is left. The request body can be up to 8 MB. Parameters such as temperature, top_p, stop, seed and the frequency and presence penalties are passed through to the model.
When you go over a limit, the API answers with HTTP 429. The error code tells you which limit you hit: rate_limited means too many requests per minute, and concurrency means too many requests at once. A 429 can also mean temporary overload, in which case the response includes a Retry-After: 5 header. In all three cases the fix is the same: wait and send the request again, ideally with a growing delay.
import os, time
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.hereticllm.com/v1", api_key=os.environ["HERETIC_API_KEY"], max_retries=0)
def ask(messages, tries=5):
for attempt in range(tries):
try:
return client.chat.completions.create(model="uncensored", messages=messages)
except RateLimitError:
time.sleep(min(5 * (attempt + 1), 30))
raise RuntimeError("still rate limited after retries")The retry above sleeps 5 seconds after the first failure, 10 after the second, and so on up to 30. If you see concurrency errors often, put a semaphore in front of your calls so that no more than 8 run together (2 on a trial key). If you see rate_limited, spread batch jobs out over time.
Failed or refused requests are not charged, so retrying costs nothing extra. Prompts are not used for training. For the full parameter list and error format, read the API documentation. If you are curious about what kind of model sits behind the endpoint, the abliterated LLM page gives background.
More guides
Questions and answers
Do I need a special SDK for Heretic LLM?
No. The official OpenAI SDKs for Python and Node work as they are. Set the base URL to https://api.hereticllm.com/v1, use your key, and request the model uncensored.
What model name do I put in the request?
Use uncensored. GET /v1/models lists the same ID, and there is only one model behind the API.
Can I try it before paying?
Yes. After sign-up you can claim $0.50 of trial credit with one click on the API key page. It needs no card, lasts 7 days and is limited to one claim per person.
Does it support streaming, tool calling and JSON mode?
Yes to all three. Streaming uses server-sent events, tool calling follows the OpenAI tools format, and JSON mode is enabled with response_format set to json_object.
Can it generate images or embeddings?
No. The API is text only, with chat completions and a model list. There is no image, audio or video generation, no embeddings and no fine-tuning.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.