ms ▾
Get API key

API Documentation

Get started with the uncensored LLM API in minutes. Send a chat completion request using your preferred language and start generating text immediately.

Base URL and Authentication

The heretic model API is fully OpenAI compatible. Use the base URL https://api.hereticmodel.com/v1 with any standard client. Authenticate by passing your API key in the Authorization header. Create your key instantly via Google or email on the dashboard. No phone number is required. The key is displayed immediately after creation.

Each account supports one active key. Generating a new key replaces the previous one. Keep your key secure to avoid unauthorized usage. Errors and refusals do not consume your prepaid credit.

Your First Request

Send a standard chat completion request to generate text. The endpoint accepts JSON payloads with a model ID and messages array. Use the model ID uncensored for the dedicated instance. It responds without content refusals for lawful adult use.

curl https://api.hereticmodel.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Return current UTC time and date."}]
  }'

This request demonstrates the core functionality. Input text goes in, and text comes out. You can adjust parameters to control the output style. The API handles the rest efficiently.

Python SDK Integration

Use the official OpenAI Python library to interact with the API. Set the base URL to our endpoint and provide your API key. The library handles serialization and response parsing automatically. This approach works for most standard use cases.

from openai import OpenAI

client = OpenAI(base_url="https://api.hereticmodel.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)

Configure the client to point to our servers. Pass your messages and desired parameters. The response object contains the generated content. You can access the text directly from the response object.

Node SDK Integration

Install the OpenAI Node.js package to start building applications. Configure the base URL and API key in the client instance. This allows you to integrate uncensored generation into your Node environments easily. Streaming and parsing are handled by the library.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.hereticmodel.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);

Initialize the client with your credentials. Call the chat completions endpoint with your messages. The response provides the generated text. You can handle errors and rate limits programmatically.

Streaming and Token Usage

Enable streaming by setting the stream parameter to true. The API returns a Server-Sent Events (SSE) stream. Token usage information is included in the last chunk of the stream. This allows real-time display of generated text.

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)

Parse the stream to handle each chunk as it arrives. Monitor token usage to manage your prepaid credit effectively. Errors during streaming do not charge your account. Adjust the max_tokens parameter to limit output length.

Limits, Errors, and Context

The context window supports 100,000 tokens for prompt and completion combined. Max output is 16,000 tokens per request. You can send 300 requests per minute per key. Concurrency is limited to 8 simultaneous requests. Request bodies must be under 8 MB.

Handle errors gracefully. A 401 error indicates an invalid API key. A 402 error means you need to top up your crypto credit. A 429 error signals that you have exceeded the rate limit. Top up using USDT or USDC to continue.

Frequently asked questions

How do I get an API key for the heretic model?

Navigate to the 'Get API key' page and sign in with Google or an email and password. The API key is displayed immediately after signup. No phone number is required for registration.

What happens if I hit a rate limit?

You will receive a <code>429</code> status code. The limit is 300 requests per minute per key. You can wait for the window to reset or use a new key if you have created one.

Does the uncensored model support function calling?

Yes, the API supports function calling via the <code>tools</code> and <code>tool_choice</code> parameters. You can also use JSON mode by setting <code>response_format</code> to <code>json_object</code> for structured outputs.

Get your API key

Register, copy the credential, update your endpoint. Done.