Deploy Your Bot

There are two ways to integrate your bot: the embeddable widget for websites, or the API for custom applications.

Option 1: Widget (Recommended)

The easiest way to add your bot to a website. Just copy and paste a single script tag.

Get Your Widget Code

  1. Go to your bot's Developer tab
  2. Click Widget in the sidebar
  3. Copy the embed code

Add to Your Website

Paste the code just before the closing </body> tag:

<!-- RAG Chats Widget -->
<script
  src=500">class="text-green-500">"https:500">class="text-muted-foreground500">class="text-green-500">">//widget.ragchats.ai/embed.js"
  data-bot-id=500">class="text-green-500">"YOUR_BOT_ID"
  data-api-key=500">class="text-green-500">"YOUR_API_KEY"
  500">async
></script>

That's it!

The chat widget will appear in the bottom-right corner of your website. Your visitors can now ask questions about your content.

Customize the Widget

You can customize colors, position, and behavior. See the Widget Documentation for all options.

<script
  src=500">class="text-green-500">"https:500">class="text-muted-foreground500">class="text-green-500">">//widget.ragchats.ai/embed.js"
  data-bot-id=500">class="text-green-500">"YOUR_BOT_ID"
  data-api-key=500">class="text-green-500">"YOUR_API_KEY"
  data-position=500">class="text-green-500">"bottom-left"
  data-primary-color=500">class="text-green-500">"#6366f1"
  data-welcome-message=500">class="text-green-500">"Hi! How can I help you today?"
  500">async
></script>

Option 2: API Integration

For custom applications, mobile apps, or backend integrations, use the REST API.

Get Your API Key

  1. Go to your bot's Developer tab
  2. Click API Keys
  3. Click Generate New Key
  4. Copy and securely store your API key

Keep Your API Key Secret

Never expose your API key in client-side code. Always make API calls from your server.

Make Your First API Call

Response Format

{
  "response": "Our return policy allows returns within 30 days of purchase...",
  "conversationId": "conv_abc123",
  "messageId": "msg_xyz789",
  "sources": [
    {
      "title": "Return Policy",
      "dataSourceName": "Help Center",
      "snippet": "...returns within 30 days of purchase...",
      "score": 0.94
    }
  ],
  "latency": 823,
  "model": "gpt-4o"
}

Domain Whitelisting

For security, you should whitelist the domains where your widget can be used:

  1. Go to your bot's Settings tab
  2. Find Allowed Domains
  3. Add your domains (e.g., example.com, *.example.com)

Development

localhost is automatically allowed for development.

Rate Limits

API requests are rate limited based on your plan:

PlanRequests/minRequests/day
Free10100
Starter605,000
Pro30050,000
EnterpriseCustomCustom

Going to Production

Before going live, make sure you've:

  • Tested thoroughly with real user questions
  • Set up domain whitelisting
  • Customized the widget to match your brand
  • Reviewed your system prompt
  • Set up monitoring in the Analytics tab

Next Steps