# How to add an AI chatbot to a Bolt app

**Bolt usually generates a Vite project, so the chatbot goes in `index.html`, just before `</body>`. Ask Bolt to do it.** Get a key at [/get-api-key](/get-api-key) first.

## Paste this into the Bolt chat

> Add this script tag to index.html right before </body>. The data-key is a public key, so keep it inline:
> `<script src="https://onelinechat.com/widget.js" data-key="olc_pub_YOUR_KEY" async></script>`

## Notes

- If Bolt made a Next.js project instead, use the [Next.js guide](/install/nextjs). The tag goes in `app/layout.tsx`.
- Bolt's in-editor preview and published `*.bolt.host` addresses are allowed automatically.

---
Source: https://onelinechat.com/install/bolt · Last updated: 2026-11-20 · All docs: https://onelinechat.com/llms.txt
