Skip to main content
This guide walks you through embedding the chat widget on your site and sending your first message.

Prerequisites

  • An Agentic Trust account with a project created in the dashboard
  • Your API key (lum_pk_...) and Project ID (proj_...) from the project settings page

Embed the widget

1

Add the script tag

Include the widget script in your HTML:
<script src="https://platform.agentictrust.com/widget.js"></script>
2

Initialize the widget

Call initAsync with your project credentials:
<script>
  AgenticTrust.initAsync({
    projectId: "proj_your_project_id",
    apiUrl: "https://platform.agentictrust.com/api/v1",
    apiKey: "lum_pk_your_api_key"
  });
</script>
The widget bubble appears in the bottom-right corner of your page.
3

Test it out

Click the widget bubble and send a message. If you’ve added knowledge sources in the dashboard, the agent will answer from your content.

Send a message via the API

You can also interact with the agent programmatically.
1

Create a conversation

curl -X POST "https://platform.agentictrust.com/api/v1/chat/conversations" \
  -H "x-api-key: lum_pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"endUserExternalId": "user-42"}'
Save the conversationId from the response.
2

Stream a response

curl -N -X POST "https://platform.agentictrust.com/api/v1/chat/messages" \
  -H "x-api-key: lum_pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "conversationId": "conv_abc123",
    "projectId": "proj_your_project_id",
    "messages": [{"role": "user", "content": "Hello, how can I reset my password?"}]
  }'
The response streams back as Server-Sent Events.

What’s next