EN ▾
Uncensored AI API for free usehttps://api.apisemrestricoes.com/v1

Uncensored free chatbot: build yours in Python

An uncensored free chatbot that you control yourself is less work than it seems: about 40 lines of Python and the $0.50 free trial credit are enough to chat for over a thousand messages. See the code and the counter.

Uncensored AI: Checklist for Production Implementation

Updated

Chat bubbles over a terminal and a coin meter, illustrating a home-built chatbot with trial credit

Key points

  • About 40 lines of Python form a functional chatbot in the terminal
  • The $0.50 free trial credit yields around 1,260 messages in this design
  • Truncating history keeps the cost per message stable
  • Adult use and within the law, text only

What you will build

Looking for an uncensored free chatbot on ready-made sites usually ends up with message limits and changing rules. The alternative is to build your own: a terminal program that saves history, calls the API, and prints the response. You choose the tone, the persona, and the memory size.

The "free" here has a clear limit. After registration, the key page allows redeeming $0.50 of free trial credit with one click, once per person and valid for 7 days. It is not unlimited use, but it is much more than needed to build and test the bot. The results below show how much each message consumes.

Preparation

  1. Create the account, redeem the credit, and copy the key.
  2. Install the SDK: pip install openai.
  3. Store the key in an environment variable, for example export API_KEY="SUA_CHAVE".

The base URL is https://api.apisemrestricoes.com/v1 and the model is uncensored. The test key allows 2 parallel requests and 60 per minute, which is plenty for a personal bot.

The full chatbot code

The program below keeps history in a list, truncates old messages, and adds the cost of each response from the usage field.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.apisemrestricoes.com/v1",
    api_key=os.environ["API_KEY"],
)

SISTEMA = (
    "Você é o Bento, um narrador de histórias de aventura para adultos. "
    "Responda em português, em até três parágrafos, e mantenha o clima da cena."
)
MAX_MSGS = 10          # quantas mensagens recentes ficam no histórico
historico = []
gasto = 0.0

while True:
    entrada = input("Você: ").strip()
    if entrada in ("sair", ""):
        break
    historico.append({"role": "user", "content": entrada})
    historico = historico[-MAX_MSGS:]

    r = client.chat.completions.create(
        model="uncensored",
        messages=[{"role": "system", "content": SISTEMA}] + historico,
        max_tokens=400,
    )
    texto = r.choices[0].message.content
    historico.append({"role": "assistant", "content": texto})

    u = r.usage
    gasto += u.prompt_tokens * 0.15 / 1e6 + u.completion_tokens * 0.50 / 1e6
    print(f"\nBento: {texto}\n[gasto na sessão: US$ {gasto:.5f}]\n")

Run with python bot.py and chat. The MAX_MSGS limit is what keeps the cost down, as I explain further down.

How each part works

The system prompt

It is the bot's persona. It stays outside the history and goes at the start of every call, so it should be short. A 200-token system prompt, repeated in every message, is already paid input each time.

The history

The API does not keep memory: you resend what you want the model to remember. The historico list accumulates user and bot messages, and the truncation [-MAX_MSGS:] keeps only the most recent ones.

The spending counter

The usage field provides the input and output tokens of each response. The formula uses prices of $0.15 per 1M input and $0.50 per 1M output. To check with the server, the X-Balance-USD header shows the balance, and so does GET /v1/balance.

Personality adjustments

The persona comes from the system prompt, but some parameters change the writing style. temperature controls variety: higher values generate more creative and less predictable text. top_p does something similar via another path, so change one at a time. stop cuts generation at a sequence you define, and seed helps repeat a test. Repetition penalties reduce the tendency for the bot to repeat the same phrases in long conversations. Note what changed with each test, otherwise it is hard to know what improved the response.

Streaming

To see the response appear gradually, pass stream=True and iterate over the chunks. Streaming uses SSE and delivers token usage at the end. The documentation has the full example.

How many messages fit in the trial credit

Let's do a realistic estimate for this bot. Assumptions: 200-token system prompt, 60-token user message, 250-token response, and history truncated to 10 messages (5 from the user and 5 from the bot).

  • History: 5 x 60 + 5 x 250 = 1,550 tokens
  • Input per request: 200 + 1,550 + 60 = 1,810 tokens
  • Input cost: 1,810 × 0.15 / 1,000,000 = $0.0002715
  • Output cost: 250 × 0.50 / 1,000,000 = $0.000125
  • Total per message: $0.0003965

Dividing $0.50 by this value, the free trial credit gives about 1,260 messages. If you chat 30 times a day, that's more than 40 days of chatting, but the credit is only valid for 7 days, so the real limit is time, not balance. After the period, top up the minimum of $20, which yields about 50,000 messages on the same profile ($20 divided by 0.0003965).

What happens without history truncation

To see why truncation matters, imagine the same bot without MAX_MSGS. Each round adds 310 tokens to the history (60 from the user and 250 from the bot). By the 100th message, the input reaches about 200 + 99 x 310 + 60 = 30,950 tokens. That is, the input cost of that single request is 30,950 x 0.15 / 1,000,000 = $0.0046, plus $0.000125 for output: about $0.0048, nearly 12 times the cost of a message with truncated history.

Truncation has a price: the bot forgets the beginning of the conversation. A common solution is to periodically ask the model itself for a short summary of the history up to that point and save that summary as the first message in the history. The 100,000-token context window is a safety ceiling, not a target.

Another option is to vary the truncation based on the type of conversation. For a quick Q&A bot, 4 messages are enough. For a long story, 20 messages maintain more continuity, but double the input cost compared to 10. Test different values and compare the spending shown in the program counter.

Usage rules and next steps

The model is open, hosted by an independent provider, and responds without content refusals for legal adult use. This requires builder responsibility. If it is open to others, state that it is for adults only and record this in your service terms. Sexual content involving minors is prohibited, without exception. The API generates text only.

If you deploy the bot to a server, never put the key in the browser or the user's app: it must stay only in your back-end. Also control the number of requests per user, since the full key accepts 8 concurrent requests and 300 per minute, and a streaming response occupies the slot until the end. For the step-by-step guide to a secure deployment, see the production checklist.

When the trial ends, top-ups range from $20 to $500, in USDT on the TRC20 network or USDC on the Base network, with a 5% bonus from $50, 10% from $100, and 15% from $200. See details at pricing.

More guides

Frequently asked questions

Is the chatbot really free?

You use the free $0.50 trial credit, valid for 7 days and one per person. After that, usage is pay-as-you-go, starting from a $20 top up.

Do I need to know how to code?

A little Python helps. The code above works by pasting and changing only the key, which goes into an environment variable.

Can I use another language?

Yes. Any OpenAI-compatible client works. Just use the API base URL, the key, and the uncensored model.

Does the chatbot generate images?

No. The API is text-only, with no image, audio, or video.

How many messages per minute can I send?

With the trial key, 60 per minute and 2 at the same time. With the full key, 300 per minute and 8 at the same time.

Your key is one form away

Create an account, copy the key, and change the base URL. That's all the configuration.