Skip to content

Embed options: script tag or REST endpoint

Choose between the drop-in widget script and calling the chat REST endpoint from your own interface.

Last verified 2026-07-24

Two ways to put chat in front of visitors

Open your chatbot and go to the Installation tab. It shows both options: a script tag that renders the full chat widget, and a curl example for calling the chat REST endpoint directly. The script embed is the recommended route for almost everyone.

The script embed (recommended)

Copy the script tag from the Installation tab and add it to your site's HTML. That one tag loads the complete widget with everything you configured in the dashboard:

  • Answers stream in with a typing indicator, and up to 4 source citations appear under an answer.
  • Lead capture, conversation starters, proactive messages and your Appearance settings all work without extra code.
  • The widget renders inside a Shadow DOM, so your site's CSS and the widget's styles do not interfere with each other.

Changes you make in the dashboard reach live sites on their own. Allow up to about 60 seconds for the configuration cache to refresh. For the step-by-step install, see install the chat widget.

What the script exposes

The embed is self-contained and carries only the public bot id, in a data-bot-id attribute on the tag. There is no API key or other secret in your page source, so the tag is safe to publish on any public page. Anyone who views your site's source sees only an identifier that already appears wherever the widget runs.

Calling the chat endpoint directly

If you are building your own chat interface, for example an assistant inside your app, you can skip the widget and call the chat REST endpoint yourself. A curl example is shown on the Installation tab, ready to adapt.

On this route you own the interface. The endpoint returns the answer; rendering, input handling and any extras like a contact form are yours to build. The widget's built-in behaviour, such as the lead form and conversation starters, applies to the widget only.

For programmatic access beyond chat, such as creating chatbots, adding sources or reading leads, use the public REST API, available on the Standard plan and higher.

Which route to choose

  • Use the script embed when you want chat on a website. One tag, no code, and every dashboard setting applies.
  • Use the REST endpoint when you are building your own interface or sending messages from another application.

Messages count against your monthly message quota on both routes.

Try it on your own content

Everything in this article works the same on the free trial. Train a bot on your site and see it answer with sources.

Book a demo

No credit card required. Plans start at $29/mo after the trial.