# SleekAI 3.0: Chatbots on Any Website, With Capped Costs

SleekAI 3.0 is a major release built on the new shared foundation of every
SleekWP plugin. Your chatbots can now answer on any other website, public
chatbots have a hard ceiling on what they can cost, and chatbots, the Agent's
role settings and its modes move into SleekAI's own database tables.

## Chatbots on other websites

A saved chatbot can be shown on any other website with a script tag, as the
floating widget or as an embedded chat. You decide where it may run: a public
key from the workspace's **Public keys** settings lists the sites it is allowed
on, and both the script and the chatbot's page are rate limited per key and per
visitor address. [Other sites](/docs/ai/chatbots/embed.md) in the docs walks
through the setup.

## Costs that stay capped

A public chatbot answers all of its visitors together at most 200 messages an
hour and 1,000 a day, so its cost stays capped however many visitors or
addresses send messages. Each visitor gets at most 30 answers in five minutes.
The `sleekAi/chatbot/budget` and `sleekAi/chatbot/rateLimit` filters change
either limit per chatbot.

## Ready for cached pages

A chatbot can render in public context, so a cached page serves the same
widget to every visitor: set `visitorContext` to `anonymous` inline, add
`visitor_context="anonymous"` to its shortcode, or use the
`sleekAi/chatbot/visitorContext` filter. Chatbots also no longer include site
data in the page, so purge your page caches and CDN after updating.

## Chatbots for your own code

New PHP functions read and save chatbots and read the Agent's role settings and
modes, such as `sleek_ai_get_chatbot()` and `sleek_ai_save_chatbot()`; the
[Developer API](/docs/ai/api.md) page lists them. A new
`sleekAi/chatbot/maxRequestBytes` filter limits the size of a chatbot request.

## Its own tables

Chatbots, the Agent's role settings and custom Agent modes are now kept in
SleekAI's own database tables instead of as posts, with the same IDs. The
`[sleek-ai-chatbot id]` shortcode, `sleekAi_render_chatbot()`, chatbot logs and
embed keys keep working, and the update moves everything once. They are no
longer part of WordPress's **Tools > Export** file; Agent Sync's files in your
theme and `wp sleek ai chatbot get` keep a copy of each chatbot.

## A rebuilt workspace

- A rebuilt administration application.
- A **Docs** page after License holds the documentation inside the workspace.
- **Settings** holds the AI provider keys, shared with every SleekWP plugin on
  the site, and uninstalling keeps them.
- A light, dark and system theme selector in the header replaces the
  Appearance page.
- The Agent runs the modes the builders' code defines. The element picker, HTML
  references and plugin mode are gone, and custom modes made in the 2.2 mode
  editor are no longer listed; they stay stored, untouched.

## Coming from SleekAI 1

A site that still holds what SleekAI 1 saved keeps it, whether it updates from
1.x directly or ran 2.x in between: provider keys move to the shared AI
settings, chats open in Chats with their messages and tags, and chatbot logs
appear under their chatbot. SleekAI 1's per-user temperature, system
instruction and streaming choice and the `/ai` command with its presets have no
counterpart and are not carried over.

## Before you update

SleekAI 3.0 requires **PHP 8.2 and WordPress 6.9**. A site below either keeps
its current release, so the updater never moves it. Stored API keys are now
encrypted with a key unique to your site, which means rolling back to an
earlier version needs them entered again. As with any major release, back up
your database and files first, because downgrading after the migration is not
supported.

The full list of changes is in the [changelog](/ai/changelog/), and the
[SleekAI docs](/docs/ai.md) cover every feature.
