EN ▾

Uncensored API. OpenAI compatible.

Get API key

Build a No Filter AI Chat App With an API

A no filter AI chat app is a small program: a loop, a message list and one API call. This guide builds it in Python, adds a system prompt and memory that fits the 100,000-token window, and shows what a long conversation costs.

Updated

Two glass chat bubbles joined by a looping line of light, representing a conversation loop with an API
Three glass theatre masks on a stage, representing different system prompt personas for a language model

No card needed. After sign-up, claim $0.50 of free test credit with one click (once per person).

Get API key

What you are building

People who search for no filter AI chat usually want one of two things: a ready-made website, or a way to build their own chat. This article is for the second group. You will write a terminal chat that talks to an OpenAI-compatible endpoint serving a model tuned to answer without content refusals for lawful adult use. Once it works in a terminal, the same loop moves into a web backend, a Discord bot or a desktop app.

The pieces are few. A system prompt that sets behaviour, a list that stores the conversation, a call to /v1/chat/completions with stream: true, and a rule for what to drop when the history gets long. The service has no hidden session state, which is both the catch and the advantage: you decide what the model sees.

Setup

Create a key on the API key page. New accounts can claim $0.50 trial credit with one click, no card needed. Then install the SDK:

pip install openai
export NOFILTER_KEY="your-key-here"

The base URL is https://api.nofilter.top/v1 and the model id is uncensored. Auth is a standard Bearer key, which the SDK sends for you.

The full chat loop

This version streams tokens as they arrive and keeps the conversation in memory.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.nofilter.top/v1",
    api_key=os.environ["NOFILTER_KEY"],
)

SYSTEM = (
    "You are a candid conversational partner for adult users. "
    "Answer directly, without disclaimers or lectures. "
    "Keep replies under 200 words unless asked for more."
)

history = [{"role": "system", "content": SYSTEM}]

while True:
    user = input("you> ").strip()
    if user in {"/quit", "/exit"}:
        break
    history.append({"role": "user", "content": user})

    stream = client.chat.completions.create(
        model="uncensored",
        messages=history,
        temperature=0.8,
        stream=True,
    )

    parts = []
    print("bot> ", end="", flush=True)
    for chunk in stream:
        if chunk.choices and chunk.choices[0].delta.content:
            piece = chunk.choices[0].delta.content
            parts.append(piece)
            print(piece, end="", flush=True)
    print()
    history.append({"role": "assistant", "content": "".join(parts)})

A few details in the loop are worth understanding. The stream=True flag makes the server send small chunks over SSE, so the first words appear quickly instead of after the full reply is finished. The final chunk carries usage, which is where you read exact token counts. The check on chunk.choices is there because some chunks, such as the final usage one, carry no text delta.

That is the whole app. Notice that the assistant reply is appended to history after the stream finishes. If you skip that line, the model will not remember what it said, and conversations will feel broken.

Write the system prompt like a spec

With fewer built-in refusals, the system prompt carries more weight. Say who the bot is, how it should sound, and where its limits are. Vague prompts such as "be uncensored" give vague, rambling behaviour. Specific prompts give stable personas.

A good test of any system prompt is to try to break it yourself. Ask the bot to ignore its instructions, switch tone mid-conversation, or answer in a format it was told not to use. When the prompt fails, tighten the wording instead of adding more rules; short and unambiguous beats long and contradictory. If the bot keeps lecturing, say so in one plain sentence and put that sentence near the start. If it ignores the length cap, state the cap as a number of words rather than as "be brief".

Our page of system prompt examples has ready patterns for personas, tutors and writing partners that you can adapt.

Conversation memory inside the 100k window

The context window is 100,000 tokens, counting prompt and completion together. A chat turn of 60 user tokens and 250 reply tokens adds about 310 tokens, so you could in theory hold over 300 turns. In practice you will want to trim earlier, for cost and for focus.

There is also a quality reason to trim. Very long histories dilute the instructions at the top, and a chat that has run for hours may start to repeat itself or lose its persona. Starting from a compact summary often gives better replies than carrying every old line. Keep the system message first in the list at all times, since it defines the behaviour of the whole session.

Three simple strategies, from easiest to best:

  1. Sliding window. Keep the system message plus the last N messages. Easy, but the bot forgets early facts.
  2. Summary plus recent turns. When history passes a threshold, ask the model to summarise the oldest half in 150 words, then replace those turns with the summary.
  3. Pinned facts. Keep a short list such as "user's name is Dana; prefers short answers" in the system message and update it as you learn more.
def trim(history, keep=24):
    system, rest = history[0], history[1:]
    return [system] + rest[-keep:]

Call trim(history) before each request. The usage block in the final response chunk tells you real token counts, so you can switch from a fixed turn count to a token budget when you need to.

What a long chat costs

Cost grows faster than most people expect, because every turn resends the whole history. Take a 50-turn chat with a 150-token system prompt and about 310 new tokens per turn (60 user, 250 reply), with no trimming.

The $0.50 trial credit therefore covers roughly seven chats of that length. With a sliding window of 24 messages, the input side stays flat and the cost drops further. See pricing for top-up amounts and bonuses.

Limits and error handling

A full key allows 8 concurrent requests and 300 requests per minute; a trial key allows 2 and 60. Going over returns HTTP 429 with the code rate_limited or concurrency. On temporary overload you also get a 429 with a Retry-After: 5 header. A streamed request holds its concurrency slot until the stream ends, so a web app with many users should queue requests per account.

If you plan to put this behind a website, keep the API key on your server and never ship it to the browser. Your backend authenticates the user, trims their history, calls the API, and forwards the stream. Track each account's recent usage so one heavy user cannot occupy all eight concurrency slots. The response headers X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency tell you your ceilings, and X-Balance-USD shows the remaining credit after each call.

Wrap the call in a retry that waits for Retry-After and gives up after a few attempts. Failed requests are not charged, so retrying is safe for your balance. For tool use, web search or structured output on top of this chat, see the article on LLM tool calls and the docs.

Examples 4 and 5: structured output and plain answers

Example 4: structured output without chatter

Not every use of an unfiltered model is creative. Moderation teams, researchers and data builders use it to produce labelled examples or to classify text that other models decline to read. For that work, you want the model to behave like a function.

You are a text classifier for a trust and safety dataset. For each input, return only a JSON object with the keys label (one of: harassment, threat, spam, other), confidence (a number from 0 to 1) and reason (one sentence). Do not quote the input back. Do not add commentary before or after the JSON. If the input is empty, use the label other and confidence 0.

Pair this prompt with JSON mode (response_format: {"type": "json_object"}) and a low temperature, such as 0.1. The prompt names the keys, and the setting guarantees valid JSON, so each covers the other's gap.

Example 5: a plain-spoken assistant

For internal tools where people want straight answers, a short prompt is often enough:

You are a direct assistant for adult users. Answer the question first, in the first sentence, then add context only if it changes what the user should do. Do not open with a warning, and do not repeat the question back. If you are unsure, say so and name what would settle it. Use plain words and short paragraphs.

The line "if you are unsure, say so" matters more than it looks. A model without refusals still guesses, and plain-spoken confident answers make a wrong guess more persuasive. Giving permission to express doubt keeps the style direct without giving up honesty.

Wiring a system prompt into the API

The system prompt is the first message in the messages list with role: "system". The rest of the conversation follows. Here is the editor prompt from Example 1 in Python:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.nofilter.top/v1",
    api_key="YOUR_API_KEY",
)

EDITOR_PROMPT = (
    "You are a developmental editor who works with adult fiction writers. "
    "Give feedback in three parts: what works, what drags, and what to cut first. "
    "Quote short phrases. Do not soften criticism. Keep each part under 120 words."
)

reply = client.chat.completions.create(
    model="uncensored",
    messages=[
        {"role": "system", "content": EDITOR_PROMPT},
        {"role": "user", "content": "Scene: the ferry stalls and the lights go out."},
    ],
    temperature=0.7,
    seed=42,
)

print(reply.choices[0].message.content)

The same request as a curl call, useful for quick experiments:

curl https://api.nofilter.top/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "temperature": 0.7,
    "messages": [
      {"role": "system", "content": "You are a direct assistant for adult users. Answer first, then add context."},
      {"role": "user", "content": "Is it worth learning Rust as a Python developer?"}
    ]
  }'

Streaming (stream: true) works with system prompts as usual, and so does tool calling. See the documentation for the full parameter list. The seed parameter is passed through, which helps when you compare two versions of a prompt on the same input.

Testing prompts and what they cost

Change one thing at a time. Keep a file of ten to twenty representative user messages, run them through the old and new prompt with the same seed and temperature, and read the outputs side by side. Look for rule violations first (too long, wrong format, broke character), then for quality. Automate the first check with a small script and read the second yourself.

Prompt length costs money because the system prompt is sent with every request. At $0.15 per 1M input tokens, a 500-token prompt sent 1,000 times is 500,000 input tokens, which costs $0.075. A 2,000-token prompt sent 1,000 times is 2,000,000 tokens, which costs $0.30. Neither is a large number, but a companion app with thousands of daily chats will notice the second. Trim repeated instructions, and move rarely needed rules into a separate tool or a conditional block that your code adds only when relevant.

Failed or refused requests are not charged, and credit never expires, so experimentation is cheap. The $0.50 trial credit, claimed with one click on the API key page, is enough for a few hundred test runs of a short prompt. For rates and top-up bonuses, see pricing.

Common mistakes

For background on what kind of model these prompts run on, the page about uncensored models explains the approach and its limits.

Questions and answers

Does the API remember my conversation?

No. Each request is independent. You send the full message list every time, which is what the history variable does in the code above.

Is there a web interface I can use instead of coding?

This service is an API for developers. You can connect it to any chat client that accepts an OpenAI-compatible base URL and key.

Can the bot generate images?

No. It is text only, with no image, audio or video generation.

Are there any content limits at all?

The model is tuned for lawful adult use without content refusals, with one hard limit: no sexual content involving minors.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key