Embed Ask AI
Put an Ask AI button or input bar on your website, in your dashboard, or inside your product, so readers can ask the docs without leaving the page.
The embedded assistant is the same Ask AI as on your docs site: the same model, instructions, custom answers, and content sources. Questions go to the same question log and count toward the same limits.
Get started
Add the allowed origins
Under "Ask AI → Embed" of the site, enter the websites that may embed the site's assistant (requires the admin role), for example https://app.acme.com; https://*.acme.com covers any subdomain. Up to 20, https only except for localhost. Changes apply right away.
You can also set them through the API. Without any origins, the assistant can't be embedded.
Add the script
Copy the embed code on the same page and paste it before </body> on your pages:
<script src="https://docs.acme.com/_biti/embed.js" async></script>The default entry set in the console appears on the page (a button in the bottom-right corner until you choose otherwise) and opens the panel. To use a button or an input bar on this page regardless, add data-trigger="button" or data-trigger="bar".
Entry styles
data-trigger sets where readers open the panel from:
button: a floating button in the bottom-right corner, with an icon and "Ask AI".bar: an input bar at the bottom center of the screen. Readers type their question right there; Enter expands the panel and answers at once. When there's already a conversation, clicking into the bar opens the panel; when there isn't, up to three suggested questions (fromai.suggestions) float up above the bar, ready to ask with one click.none: no entry; you open it from code.- A CSS selector (such as
#ask-docs): opens it when a matching element on the page is clicked.
Without data-trigger, the default entry style set under the site's "Ask AI → Embed → Appearance" applies (a button until you choose otherwise). When set, the page's choice applies, whatever the console says. For example, to keep the button across your website but use the input bar on your help center:
<script src="https://docs.acme.com/_biti/embed.js" data-trigger="bar" async></script>The panel opens where the entry is. Readers can:
- Drag its top edge, its sides, or its top corners to resize it, and double-click an edge to bring back the default size and position.
- Hold the panel's header to move it.
- Use the buttons in the panel's top-right corner to switch between light and dark, or to enlarge it to nearly the full height of the screen.
- Drag the entry anywhere on the screen: hold and drag the button itself, or hold the stars at the left of the input bar. Double-click the button or the stars to put it back where the website places it.
These adjustments stay in the reader's browser for a day and apply whenever they open the panel again in that time. On phones and other narrow screens, the panel slides up from the bottom instead.
Skins
There are two skins:
- Classic (default): a clean, solid entry and panel.
- Aurora: the entry and panel are frosted glass, with colored light flowing slowly along the edges. The light brightens when a reader focuses the input bar and flares once when the panel opens.
In both skins, rotating neon light glows inward from the panel's edges while the AI answers, and fades out when the answer is done. The light stands still when the system's "reduce motion" setting is on.
The skin, along with the entry style, color mode, and accent colors below, can be set under "Ask AI → Embed → Appearance" of the site. It applies as soon as you save, with no new deployment and no change to your website's code.
Options
You can also set them on the page with data attributes on the script tag. Attributes you write take priority; the rest follow the appearance set in the console:
<script
src="https://docs.acme.com/_biti/embed.js"
data-trigger="bar"
data-skin="aurora"
data-theme="light"
data-color="#7c5cff"
data-color-dark="#9e8aff"
data-width="520"
data-height="680"
data-left="50"
data-bottom="32"
data-breadcrumb="Console / Buckets / Settings"
async
></script>button for a button, bar for an input bar; see Entry styles. When set, it takes priority; when missing, the default entry style from the console applies.classic.auto follows the visitor's system setting. Once a reader switches it in the panel, their choice applies until the website changes this attribute again.#7c5cff. Used for the entry's icon, the send button, and the accents in the panel. Defaults to the docs site's light-mode accent.data-color when that's set (lightened if too dark), or else the docs site's dark-mode accent is used.0 far left, 50 centered, 100 far right. The entry always stays fully on screen. You can also fill it in under "Ask AI → Embed → Embed code", and the code you copy includes it.<html lang>, or the docs site's default language when neither matches.Console / Buckets / Settings, up to 200 characters. Defaults to the page's current title. See The reader's page.Where the accent is used for icons and outlines, a color that's too pale or too deep is adjusted so it stays visible on the current background.
You can change these attributes at any time, and the change applies right away. For example, to follow your website's own theme switch:
document.querySelector('script[src$="/_biti/embed.js"]').dataset.theme = "dark";
// or
ButterIX.configure({ theme: "dark" });Open it from code
Once loaded, the script provides window.ButterIX:
ButterIX.open(); // open the panel
ButterIX.open({ question: "How do I verify webhook signatures?" }); // open with a question written in; the reader sends it
ButterIX.close();
ButterIX.toggle();
ButterIX.configure({ theme: "light", color: "#0ea5e9", left: 20 }); // change options; null restores the defaultconfigure takes the same keys as the data attributes, without data- and in camelCase: trigger, skin, theme, color, colorDark, width, height, left, bottom, label, lang, and breadcrumb.
The reader's page
With every question, the panel sends the address and breadcrumb of the page the reader is on at that moment. The AI uses them to understand what "here", "this page" or "this setting" means, and answers with what is relevant to that page first.
The breadcrumb defaults to the page's current title (in a single-page app, a new title after navigation is picked up too). When the title doesn't say where the reader is, pass a clearer path with data-breadcrumb and update it on navigation:
router.afterEach((to) => {
ButterIX.configure({ breadcrumb: ["Console", ...to.matched.map((r) => r.meta.title)].join(" / ") });
});In the console's Ask AI question log, the channel shows as "Embed"; hover the page to see the breadcrumb and the full address, and expand a question to see the full question, answer and all details. Parameters in the address that look like keys or tokens are masked.
Content Security Policy
If your website sets a CSP, allow the docs site's address:
script-src https://docs.acme.com;
frame-src https://docs.acme.com;
font-src https://docs.acme.com;Add these values to the directives you already have.
Limits
- Password-protected sites can't be embedded.
- Embedding is unavailable when Ask AI is off (
ai.enabled: false). - Source links in the panel open in a new tab.