EN ▾
Get API key

Anonymous AI Chatbot: Build One With Minimal Sign-Up

An anonymous AI chatbot is one where users share as little about themselves as possible, and where your code keeps it that way. Here is how to build one with a small backend and an OpenAI-compatible API.

Updated

Masked glass chat bubble above a server cube and filter screen, representing a privacy-minded chatbot
Theatrical masks on a lit stage with floating chat bubbles, representing an LLM roleplay session

Key points

  • True anonymity is not possible; aim for data minimisation, which you can actually deliver.
  • Collect only an email at sign-up, key the chat history to a random id, and keep your API key on the server.
  • Strip personal details from prompts and from your logs before anything is stored.
  • A Node proxy of about 40 lines can stream replies to the browser without exposing the key.

What anonymous can honestly mean

When people search for an anonymous ai chatbot, they usually want one of two things: a chat where nobody ties their messages to their real identity, or a chat that does not collect more than it needs. The first is hard to promise. Your server sees IP addresses, your host keeps access logs, and the model provider receives the text. The second is achievable, and it is what you should build and describe on your site.

So set the goal as data minimisation. Ask for an email address and nothing else. Do not ask for a real name, phone number or birthday unless a law in your region requires age checks for your content. Say plainly in your policy what you store and for how long. Users trust a modest, accurate promise more than a big vague one.

Architecture in four parts

  1. Browser app. Shows the chat, sends the user's message to your server. It never sees the API key.
  2. Your backend. Checks the session, trims the history, redacts details, and calls the model API with a server-side key.
  3. Chat store. Holds conversations under a random identifier, not under the email.
  4. Model API. An OpenAI-compatible endpoint. This service uses the base URL https://api.anonymousllmapi.com/v1 and the model uncensored.

The split between email and chat id is the heart of the design. Keep the email in a user table used only for login and billing. Give each user a random id, such as a UUID, and store conversations under that id. If someone exports the chat table, it contains no addresses. The join lives in one place that you can lock down.

A small Node proxy that streams

This Express route accepts a message, calls the model with streaming, and forwards chunks to the browser as server-sent events. The key comes from an environment variable.

import express from "express";
import OpenAI from "openai";

const app = express();
app.use(express.json({ limit: "100kb" }));

const client = new OpenAI({
  baseURL: "https://api.anonymousllmapi.com/v1",
  apiKey: process.env.LLM_API_KEY,
});

const SYSTEM = "You are a friendly companion. Keep replies short. Never ask for real names, addresses or phone numbers.";

app.post("/chat", async (req, res) => {
  const history = Array.isArray(req.body.history) ? req.body.history.slice(-20) : [];
  const messages = [{ role: "system", content: SYSTEM }, ...history];

  res.set({ "Content-Type": "text/event-stream", "Cache-Control": "no-cache" });
  try {
    const stream = await client.chat.completions.create({
      model: "uncensored",
      messages,
      stream: true,
    });
    for await (const part of stream) {
      const text = part.choices[0]?.delta?.content;
      if (text) res.write(`data: ${JSON.stringify(text)}\n\n`);
    }
  } catch (err) {
    res.write(`event: error\ndata: ${JSON.stringify("busy, try again")}\n\n`);
  }
  res.end();
});

app.listen(3000);

Two details matter. The history is cut to the last 20 turns so cost and context stay bounded, and the error message is generic so internal details never reach the browser. A streamed request holds one concurrency slot until the stream ends, so also count open streams on your side. A full key allows 8 at once.

Keep personal data out of prompts

Users type personal details into chatbots all the time. You cannot stop that, but you can reduce what leaves your server and what you keep.

  • Tell users up front. A line under the input box such as "Do not share real names, addresses or ID numbers" prevents most of it.
  • Redact in code. Replace emails, phone numbers and long digit strings before the request goes out and before the message is saved.
  • Instruct the model. A system prompt can tell it not to ask for identifying details. It is a nudge, not a guarantee.
  • Short retention. Delete conversations after a period you state. Thirty days is a common choice for small apps, but pick what fits your case.
  • No analytics on message text. Count messages and tokens, not words.

For a longer treatment of what to check on the provider side and in your logs, read the private LLM API page. Providers differ, and the useful questions are the same for all of them. On this service, prompts are not used for training, and the privacy policy has the rest.

Sign-up with only an email

Passwordless email login is the lightest option: the user enters an address, you send a one-time link, and the link sets a session cookie. You never store a password, so there is nothing to leak. Use a dedicated sending domain and keep the message plain.

Behind the scenes, create the random chat id at the first login and store only a hash of the email for lookup, using a keyed hash such as HMAC with a secret kept outside the database. You still need the real address to send the next login link, so keep it in a separate table with strict access. If you do not need to email users after sign-up, you can drop the address after verification and let people re-verify later.

The same principle applies to your own account with the API provider. Sign-up here is by Google or by email and password, and the key is created on the key page. Use a role address for it, such as one that belongs to the project and not to a person, so the account does not tie back to one individual.

Cost per conversation

Anonymous chat is often a free or low-priced feature, so know your unit cost. Prices are $0.15 per 1M input tokens and $0.50 per 1M output tokens.

Take a 20-turn chat. Because each request resends the history, input grows with every turn. Assume an average of 1,500 input tokens per request and 150 output tokens per reply. Input: 20 x 1,500 = 30,000 tokens, which is 30,000 / 1,000,000 x $0.15 = $0.0045. Output: 20 x 150 = 3,000 tokens, or 3,000 / 1,000,000 x $0.50 = $0.0015. The whole conversation costs $0.006, so 1,000 conversations cost $6.

A first top-up of $20 would therefore cover about 3,333 such conversations, and credit never expires. The bonus is +5% from $50, +10% from $100 and +15% from $200. See the pricing page for the details, and try the service first with the $0.50 trial credit, which is one click after sign-up and needs no card.

Protect your credit from abuse

An open chat with light sign-up attracts people who want free compute. Because your key pays for every request, add limits before launch, not after the first surprise.

  • Per-user quota. Count messages per day per chat id and stop at a number you can afford.
  • Input caps. Reject messages above a length you choose. Without max_tokens, a completion can use the rest of the 100,000-token window, so set a sensible max_tokens in the proxy for casual chat.
  • Global concurrency. Keep a counter of open streams and return a friendly wait message at 8. Over the limit, the API itself answers 429 with the code concurrency.
  • Balance alarm. Read X-Balance-USD from responses and email yourself when it falls under a threshold.

These checks also help privacy, since fewer stored messages means less data to protect.

Roleplay and companion bots

Many anonymous chatbots are companions or character bots for adults. Fiction and roleplay are lawful adult use, and a model tuned to answer without content refusals will keep a story going where a filtered one stops. The hard line stays: no sexual content involving minors, ever. Add an age statement to your terms and enforce it in your moderation rules. Character setup, memory and tone are covered on the page about the best LLM for roleplay, and the docs explain the parameters you will tune.

Questions and answers

Can a chatbot be fully anonymous?

No. Servers see IP addresses and the model provider receives the message text. You can minimise what you collect and keep, which is what most users actually need.

Do I need a backend?

Yes. Calling the API directly from the browser would expose your key. A small proxy that holds the key is the standard pattern.

Does the provider train on user messages?

Prompts sent to this API are not used for training. Retention and other handling details should be checked in the privacy policy.

How much does a typical chat cost?

A 20-turn conversation with about 1,500 input and 150 output tokens per request costs roughly $0.006 at $0.15 and $0.50 per 1M tokens.

Your key is one form away

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