Integration & API Documentation
Fast, production-grade integration recipes for 1ai Brain widgets, stateful vector sessions, and custom LLM routing.
Quick Start Guide
Follow these three simple steps to launch your conversational AI on your website:
Add your website in the admin dashboard to generate your widget token.
Authorize your domain (e.g. https://yourbrand.com) for security.
Copy the script tag and place before your </body>.
HTML / Vanilla JavaScript Embed
Paste the following script tag into your website template right before the closing </body> tag:
React & Next.js Integration
In Next.js (App Router or Pages Router), use the native next/script component with strategy="lazyOnload":
Standalone iFrame Embed
If your platform restricts JavaScript execution (such as certain Notion or Webflow configurations), embed the widget using an iFrame:
REST API Integration
For mobile apps, custom backend microservices, or headless chatbots, call the chat endpoint directly with your widget token:
Widget Configuration Parameters
data-tokenRequiredstringUnique client identification token generated in the dashboard.
themeColor#ea580chex / rgbPrimary brand color applied to widget launcher and user speech bubbles.
botName"1ai Assistant"stringDisplay name rendered in widget topbar header.
welcomeMessageAuto-generatedstringInitial greeting bubble displayed when visitor opens widget.
| Parameter | Type | Default | Description |
|---|---|---|---|
| data-token | string | Required | Unique client identification token generated in the dashboard. |
| themeColor | hex / rgb | #ea580c | Primary brand color applied to launcher and user speech bubbles. |
| botName | string | "1ai Assistant" | Display name rendered in widget topbar header. |
| welcomeMessage | string | Auto-generated | Initial greeting bubble displayed when visitor opens widget. |