Embed a Bot & Go Live
You've tested a bot. Here's how to put it in front of real users on your website or app.
1. Make the bot public
Open the bot and mark it public. Public bots can be called from the browser through the CORS chat endpoint without exposing a server-side key — the right choice for a website widget.
2. Embed on your site
Under Developer → Embed, grab the snippet for your bot. Drop it into your page and the chat widget renders for visitors. For a custom UI, call the chat endpoint directly:
javascriptconst res = await fetch("https://bothive.cloud/api/v1/chat", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": "bh_public_safe_key" }, body: JSON.stringify({ botId: "your-bot-id", message: userText, history }), });
3. Manage keys
Create a dedicated key per surface (site, mobile, internal) under Developer → API Keys so you can rotate one without breaking the others. See API keys & authentication.
4. Monitor what's happening
- Live Logs (Developer → Live Logs) — watch requests and errors in real time.
- Analytics / Insights — track volume, success rate, and latency.
- Usage — see credit consumption against your monthly pool.
5. Mind your quotas
Every run is rate-limited and metered against your plan, billed to the key's owner. Handle 429 responses with backoff, and upgrade under Billing when sustained traffic needs more headroom.
Going further
- Deploying Bots to Production — secrets, thresholds, monitoring.
- Understanding billing & credits — how usage is metered.
Use the test pane to iterate quickly. Every change you make is live — no need to save first.
API keys are shown only once. Store them securely and never commit them to version control.
Test your bot with edge cases before deployment. Try empty inputs, long messages, and special characters.
Chain multiple specialized bots in a workflow for better results than one general-purpose bot.