Embed an agent on your website
What you'll do: put the Help desk agent on a shop's help page as a chat button. A visitor
clicks it, asks "can I return a tent I used once?", and gets the agent's answer. The agent
searches the same policies and orders as it does in the dashboard. Your site needs one
<script> tag and no code of its own.
The agent is the one from Build a help-desk agent from documents and a spreadsheet. Any agent that answers on its Chat page works the same way.
1. Turn on the widget
Open Agents → Help desk and click the Embed on website tab.
- Show this agent as a chat widget on my website: turns the widget on. Clear it to stop the widget everywhere at once.
- Allowed domains: the sites the widget may run on, one per line.
example.comallows that host only, and*.example.comallows its subdomains, such asshop.example.com. A pasted address such ashttps://example.com/helpis saved asexample.com. To try the widget on your own computer, addlocalhost. - Title, Colour and Greeting: what the chat shows. An empty title uses the agent's name.
- Messages per visitor per hour: how many messages one IP address may send. The default is 20.
- Daily spend cap (USD): when the widget's model calls reach this amount in a day, it stops answering until 00:00 UTC. The default is 5. Only an owner or admin can change it.
Click Save. The panel on the right shows the code for your site and what the widget has spent today. Only an owner or admin can make the first save, because that save creates the widget's key. After that, an editor can change every setting except the daily cap.

Preview the widget here loads the real widget on the dashboard page. The dashboard is always allowed, so you can try the chat before you list any of your own domains. Preview messages run the agent and count toward the cap.
2. Add the code to your site
Click Copy code and paste the tag before </body> on each page that should show the
chat:
<script src="https://acruxcore.com/widget.js" data-agent="emb_5fr80X21uAZhh71jHuMV9eFM" async></script>
data-agent is the widget's public id. It is not a secret: anyone can read it in your page's
source, and the allowed domains, the per-visitor limit and the daily cap decide what it can
be used for. A self-hosted AcruxCore serves the same file from its own domain, and the code
on the tab shows that address.
If your site sends a Content-Security-Policy header, add the AcruxCore address to
script-src and connect-src, or the browser blocks the widget.
3. Chat as a visitor
Open a page with the tag and click the chat button in the bottom-right corner.

The widget keeps the conversation in the visitor's browser, so it is still there after a reload or on another page of the same site. The pencil button in the header starts a new conversation. On a phone the chat fills the screen.
Under each answer are a thumbs-up and a thumbs-down button. A click saves the rating at once and opens a box for an optional comment, and Send feedback adds the comment to that rating. A visitor who clicks the other thumb later changes the rating.

The widget draws nothing on a site that is not in the allowed domains, and the browser console shows one warning that says so.
4. Read the conversations
On the agent's Chat page, conversations that visitors started are labelled Website. Open one to see each answer with its steps, and click View trace to read the run step by step, as for any other run.

A visitor's rating and comment are saved on the answer's trace as End user feedback. They show in the trace's Feedback panel and on Observability → Feedback, which also averages the ratings by prompt version, so you can see which version of the agent's prompt visitors rate lower.

The widget's model calls run under a virtual key named Website widget: Help desk, so Gateway → Usage can show its spend apart from the rest of the team's. The daily cap is a budget on that key, and it is listed under Gateway → Budgets.
What limits the cost
The widget runs your agent on your provider account, and its address is public. Three settings bound what a visitor, or anyone who copies the code, can spend:
- Allowed domains: the API answers a browser only when the page is on one of them, so another website cannot show your widget. A script that calls the API directly is not a browser and can claim any domain, which is why the next two limits exist.
- Messages per visitor per hour: counted per IP address. Messages over the limit are refused before the agent runs.
- Daily spend cap: once the day's spend reaches it, the widget answers no new messages. The spend includes the agent's searches as well as its chat calls. The visitor sees "This assistant has reached its limit for today."
To stop the widget at once, clear the switch and save. Revoking the widget's key under Gateway → Virtual keys, or deleting its budget under Gateway → Budgets, also stops it, and the next save on the tab puts back whichever is missing.
A visitor never sees the agent's tool calls, the passages it found, SQL rows, costs or traces. The widget receives the visitor's own messages, the agent's answers and the visitor's own ratings, nothing else. A rating does not count toward the messages-per-hour limit, and each answer keeps one rating, so a new rating replaces the old one.
Next steps
- Build a help-desk agent from documents and a spreadsheet builds the agent this guide puts on a website.
- Read the search steps of a RAG agent explains the search spans in a website conversation's trace.
- Rerank and filter an agent's search results improves which passages the agent answers from.