--- title: AI chat widget | Stainless description: Add a conversational AI assistant to your documentation site to help users find answers. --- Our AI chat widget is a paid feature. See our [pricing page](https://stainless.com/pricing) for details. The AI chat widget is currently an experimental feature. The API may change in future releases. The Stainless Docs Platform includes an optional AI-powered chat widget that allows users to ask questions in natural language and receive contextual answers based on your documentation content. ## How it works The built-in AI chat widget appears as a collapsible input field in the bottom-right corner of your documentation site. When users type a question, the widget: 1. Sends the query to the Stainless AI backend 2. Searches your indexed documentation for relevant content 3. Generates accurate, SDK-aware responses using Retrieval-Augmented Generation (RAG) 4. Streams the response to the user in real-time The AI assistant understands your SDK structure, API endpoints, and documentation content, providing answers that are tailored to your specific API. ## Enabling the built-in chat To enable the Stainless-provided AI chat widget in your `astro.config.ts` file, add the `aiChat` configuration: astro.config.ts ``` import { defineConfig } from "astro/config"; import { stainlessDocs } from "@stainless-api/docs"; import aiChat from "@stainless-api/docs-ai-chat/plugin"; export default defineConfig({ integrations: [ stainlessDocs({ title: "My API Docs", experimental: { aiChat: aiChat(), }, // ... other options }), ], }); ``` After you save the configuration and rebuild your site, the AI chat widget appears in the bottom-right corner of your documentation pages. The built-in AI chat requires your documentation site to be indexed by Stainless. Stainless automatically indexes your documentation when you host with Stainless or configure your site with a Stainless project. ## Features The built-in AI chat widget includes: - **Streaming responses**: Answers appear in real-time as they are generated - **Markdown rendering**: Responses include formatted text, code blocks with syntax highlighting, and tables - **Tool visibility**: Users can see when the AI searches your documentation - **Feedback collection**: Thumbs up/down buttons allow users to rate responses - **Copy to clipboard**: Users can copy responses for use elsewhere - **Keyboard shortcuts**: Press `Escape` to close the chat interface ## Using a custom chat widget If you prefer to use your own AI assistant or chatbot instead of the built-in Stainless chat widget, you can implement a custom chat interface. This allows you to use a different AI model, custom backend, or branded chat experience. For an example of how to build a custom chat widget in Astro, see the [AI Chat Bot theme on Astro](https://astro.build/themes/details/ai-chat-bot/). ## Examples The following documentation sites use the Stainless AI chat widget: - [Stainless](https://stainless.com/docs) - [Beeper](https://developers.beeper.com) - [SendBlue](https://docs.sendblue.com) - [SafetyKit](https://docs.safetykit.com) - [Lark](https://lark.stldocs.app/) - [Val Town](https://sdk.val.town/api/typescript) ## Disabling the chat widget If you have enabled the AI chat but want to disable it, remove or comment out the `aiChat` configuration from your `astro.config.ts` file: astro.config.ts ``` export default defineConfig({ integrations: [ stainlessDocs({ title: "My API Docs", experimental: { aiChat: aiChat(), }, }), ], }); ```