Free chatbot API for websites: chat history, streaming, no backend
Is there a free chatbot API I can put on my website without a backend?
Yes. OneTag AI is a free chatbot API that a web page can call directly: each email address gets a key with 1,000,000 tokens a month and no credit card, and one call takes the new message, the earlier turns and a system prompt, and can stream the answer. The key is safe to leave in page source, so the chatbot needs no backend.
The allowance starts again on the 1st of each month (UTC). Below is a complete chat box in one HTML file, a one-line widget if you do not want to write code, what a conversation costs, and a comparison with the other free AI APIs.
Steps
Get a free key
Enter your email at onetagai.com. The key (it starts with
ot_) arrives by email. One key per email, no card.Paste the chat box
This is a working chatbot: a form, a log, and one call per message.
systemsets the bot's role,historycarries the earlier turns, andstreamshows the answer as it is written:<div id="log"></div> <form id="chat"> <input id="q" placeholder="Ask something" autocomplete="off" required> <button>Send</button> </form> <script src="https://onetagai.com/v1.js" data-key="YOUR_ONETAG_KEY"></script> <script type="module"> const log = document.getElementById("log"); const q = document.getElementById("q"); const history = []; const line = (who) => { const el = log.appendChild(document.createElement("p")); el.textContent = who + ": "; return el; }; document.getElementById("chat").onsubmit = async (event) => { event.preventDefault(); const question = q.value; q.value = ""; line("You").textContent += question; const bot = line("Bot"); try { const answer = await onetag.ask(question, null, { system: "You are the assistant of Acme Bikes, a bike shop. Answer in under 60 words.", history: history.slice(-20), stream: (delta) => { bot.textContent += delta; }, }); history.push({ role: "user", content: question }, { role: "assistant", content: answer }); } catch (e) { bot.textContent += e.code === "quota_exceeded" ? "The chat is resting for now." : e.message; } }; </script>Make it yours
Change the
systemline to describe your site and how the bot should answer. To let it answer from your own content, pass that content as the input:onetag.ask(question, document.querySelector("main"), { system, history }).
No code: a floating chat button
If you only want a chat button that answers questions about the page it is on, add this one tag instead. It adds a floating button and a chat panel, and needs no other code:
<script async src="https://onetagai.com/widget.js" data-key="YOUR_ONETAG_KEY"></script>Options such as the title, greeting, colour and position are data- attributes; they are listed in the docs.
Call it over HTTP
For a bot that runs on a server, such as a Discord or Telegram bot, the same key works with one POST. Send the earlier turns in history and the new message as the prompt:
curl https://onetagai.com/v1/ask \
-H "Content-Type: application/json" \
-d '{"key": "YOUR_ONETAG_KEY", "system": "Answer in one short sentence.", "prompt": "And in Fahrenheit?", "history": [{"role": "user", "content": "At what temperature does water boil at sea level, in Celsius?"}, {"role": "assistant", "content": "100 degrees Celsius."}]}'Python and Node examples and the streaming format are on Free LLM API.
What a conversation costs
In our test on 2026-11-10, one turn with a system line, two earlier messages and a one-sentence answer used 124 tokens (108 in, 16 out). 1,000,000 tokens is about 8,000 turns of that size; longer answers and longer histories get fewer.
The API keeps no conversation state. The page sends the earlier turns again with every message, so each turn costs more than the one before. The example sends only the last 20 messages, which caps the cost of a long conversation.
What the free key includes
| Free key | |
|---|---|
| Price | $0, no credit card |
| Tokens | 1,000,000 a month per key, input and output counted together. Starts again on the 1st (UTC) |
| Rate limit | 60 requests a minute per key, 20 a minute per IP address |
| Per call | Up to 32,000 characters of text and one image up to 2 MB; answers up to 10,000 tokens (500 by default) |
| Where the key works | Any web page on any domain, and curl or server code |
| Features | Text answers, streaming, JSON output, image input, chat history |
| Model | One fast model served through OpenRouter. You do not choose it |
| Data | Prompts, inputs and answers are not stored. Only token counts per key are kept |
| When it runs out | Calls return quota_exceeded until the 1st and you get an email. Pro is $9.9 a month for 100,000,000 tokens a month; the key stays the same |
Free AI APIs for a chatbot, compared
Any chat model API can power a chatbot. The difference for a website is where the key lives: most free tiers give you a secret key that needs a server in front of it.
| API | Callable from a public page, no backend | Free allowance | Card to start | Who signs up |
|---|---|---|---|---|
| OneTag AI | Yes. The key is public by design and can only spend its own budget | 1,000,000 tokens a month per key, reset on the 1st | No | The site owner, by email. Visitors never sign in |
| Puter.js | Yes. No key at all | No fixed number for the site. Each visitor gets a free monthly allowance on their own Puter account, then is asked to upgrade | No | Every visitor. They are prompted to sign in with a Puter account |
| Groq | No. Secret key; the official SDK disables browsers by default | Free plan, renews daily. For openai/gpt-oss-120b: 30 requests a minute, 1,000 requests a day, 200,000 tokens a day | Only to upgrade | The developer |
| OpenRouter free models | No with your own key (keep it out of client-side code). Its OAuth flow works in a page, but each visitor signs in and uses their own key | Models ending in :free: 20 requests a minute, 50 requests a day. 1,000 a day once you have bought 10 credits | Not for the 50 a day | The developer |
| Google Gemini API | No. Google's key guide says not to put keys in web apps and to run a backend proxy | Free tier with limited access to certain models. Google does not publish fixed numbers: limits depend on your usage tier and are shown in AI Studio | Only to upgrade | The developer |
| Cloudflare Workers AI | No. It runs inside a Worker you deploy, or over a REST API with a secret token | 10,000 Neurons a day (Cloudflare's usage unit), renews daily | Not stated on the pricing page | The developer |
Other providers' figures were read on their own pages on 2026-11-10; follow the link in each row for the current numbers. Free tiers change often.
Checked the same day and no longer free: GitHub Models (retired on July 30, 2026); Mistral (the free mode no longer includes API access; API keys need billing activated); Hugging Face Inference Providers (free accounts get no monthly credits); Cerebras (a $5 trial credit that expires after 30 days and needs a verified payment method).
Limits to know before you rely on it
- The bot knows only what is in the system prompt, the history and the input you pass, and it will answer confidently about things you never told it. Put the facts it needs (opening hours, prices, policies) in the system prompt or the input. There is no training step and no file upload; to answer from a whole site, retrieve the relevant pages first, as in Add 'ask the docs' AI search.
- It does not remember visitors between page loads. Save
historyinlocalStorageif the conversation should survive a reload. - Up to 100 history messages and 32,000 characters of text per call.
- One fast model answers; there is no model parameter and no function calling.
- Anyone can read the key in the page source and use it elsewhere. They can only spend the key's budget, and calls are limited to 60 a minute per key and 20 a minute per IP address. Pro keys can be locked to your domain.
Questions
Is the chatbot API really free?
Yes, up to 1,000,000 tokens a month per key, with no credit card. The allowance starts again on the 1st of each month (UTC). If a month's tokens are used up, the bot stops answering until the 1st, or until you upgrade to Pro ($9.9 a month for 100,000,000 tokens a month).
Does the chatbot remember the conversation?
Within a page view, yes, because the page sends the earlier turns in history with each message. The API itself stores nothing, so a reload starts a new conversation unless you save the history in localStorage.
Can I train the chatbot on my own content?
There is no training. You give the model your content at question time: pass the page element or your own text as the input, up to 32,000 characters per call. For a larger site, search your content first and pass the best matches.
Is this the ChatGPT API?
No. The answers come from a fast open model served through OpenRouter, and the request is not in the OpenAI format. If you need a specific model, use one of the APIs in the comparison behind your own server.
Can I use it for a Discord, Telegram or WhatsApp bot?
Yes. It is one HTTP POST from any language, with the earlier turns in history. From a server the limit you meet first is 20 requests a minute per IP address.
What stops someone from using up my chatbot's quota?
The budget is fixed, so the worst case is that the month's free tokens run out and the bot rests until the 1st; there is no bill. Rate limits slow abuse down, and a Pro key can be locked to your domain.
What happens to the text my visitors send?
It goes to the model and comes back. OneTag AI stores token counts per key for the quota and keeps no prompts, inputs or answers. The access log carries no IP addresses.
Related guides
- AI chatbot in HTML, CSS and JavaScript: complete working code
- Chatbot HTML templates: 3 free chat UIs with working AI
- How to add an AI chatbot to an HTML website with one script tag
- Add 'ask the docs' AI search to a documentation site
- Free AI API for websites: no backend, no credit card
- Is it safe to put an AI API key in a static HTML page?
Get a free key by email, paste one tag, call onetag.ask. 1,000,000 tokens a month, no card.
Updated 2026-11-11. Something wrong or missing? Email support@odysseyx.app.