Recipe: Embed the AI Widget Anywhere
Add your docs' AI assistant to your marketing site, app, or support portal.
Your doc site's AI assistant can live on any page you control — turn "Contact support" into "Ask the docs" on your marketing site, inside your app, or in your support portal.
Basic Embed
In your project, open Integrations › Chat widget, turn it on, and add every site that will embed it under Allowed origins (for example https://www.acme.com). Then copy the snippet from Embed and add it to your pages:
<project-id> is your project's UUID. The loader answers 404 while the widget is off and 403 on a site that isn't in Allowed origins.
This renders a floating chat button. The widget:
/v1/widget/<project-id>/chat with citations linking back to your docsPublic sites only. For a site behind a password, or behind access control in password or invite-only mode, the widget's chat (/v1/widget/*) answers 403 PRIVATE_SITE: the widget runs on other people's pages and can't sign a reader in, so it never answers from a private site's pages. Readers of a private site use the assistant on the site itself. Public sites are unaffected.
Page context
The widget sends the path of the page it's on (for example /dashboard/billing) with each question, so answers can take into account what the reader is looking at. There's nothing to configure.
Building a Custom UI
Skip the widget entirely and call the API from your own frontend:
A sessionId only continues the conversation when it's sent with the same visitorId that started it — otherwise a new session starts. Always keep the X-Session-Id you get back.
Add feedback buttons that call the feedback endpoint with that messageId once the stream has finished — thumbs-down answers feed your documentation gaps report (Insights › Assistant). For suggested next questions, call follow-ups with the sessionId and visitorId.
Things to Know
403 FORBIDDEN; only requests that come through the doc site (/_chat) are answered429 and 402 USAGE_LIMIT_EXCEEDED responses gracefully in custom UIs — show a cooldown message rather than an error