# How to add an AI chatbot to a v0 app

**v0 generates Next.js apps, so the chatbot is a `next/script` tag in `app/layout.tsx`. Ask v0 to add it.** Get a key at [/get-api-key](/get-api-key) first.

## Paste this into the v0 chat

> In app/layout.tsx, import Script from "next/script" and add this inside <body>, after {children}. The key is public, so keep it inline:
> `<Script src="https://onelinechat.com/widget.js" data-key="olc_pub_YOUR_KEY" strategy="afterInteractive" />`

## Notes

- `*.vercel.app` previews and your production domain are allowed automatically.
- The full code is in the [Next.js guide](/install/nextjs).

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