> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentictrust.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get your first Agentic Trust agent running in under 5 minutes.

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_...`) from the project settings page

## Embed the widget

<Steps>
  <Step title="Add the script tag">
    Include the widget script in your HTML:

    ```html theme={null}
    <script src="https://platform.agentictrust.com/widget.js"></script>
    ```
  </Step>

  <Step title="Initialize the widget">
    Call `initAsync` with your project credentials:

    <CodeGroup>
      ```html Basic theme={null}
      <script>
        AgenticTrust.initAsync({
          apiUrl: "https://platform.agentictrust.com/api/v1",
          apiKey: "lum_pk_your_api_key"
        });
      </script>
      ```

      ```html With user identity theme={null}
      <script>
        AgenticTrust.initAsync({
          apiUrl: "https://platform.agentictrust.com/api/v1",
          apiKey: "lum_pk_your_api_key",
          user: {
            id: "user-42",
            email: "user@example.com",
            name: "Jane Doe",
            hmac: "hex_sha256_signature"
          }
        });
      </script>
      ```
    </CodeGroup>

    The widget bubble appears in the bottom-right corner of your page.
  </Step>

  <Step title="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.
  </Step>
</Steps>

## Send a message via the API

You can also interact with the agent programmatically.

<Steps>
  <Step title="Create a conversation">
    <CodeGroup>
      ```bash cURL theme={null}
      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"}'
      ```

      ```javascript JavaScript theme={null}
      const res = await fetch("https://platform.agentictrust.com/api/v1/chat/conversations", {
        method: "POST",
        headers: {
          "x-api-key": "lum_pk_your_api_key",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ endUserExternalId: "user-42" }),
      });
      const { conversationId } = await res.json();
      ```

      ```python Python theme={null}
      import requests

      res = requests.post(
          "https://platform.agentictrust.com/api/v1/chat/conversations",
          headers={"x-api-key": "lum_pk_your_api_key"},
          json={"endUserExternalId": "user-42"},
      )
      conversation_id = res.json()["conversationId"]
      ```
    </CodeGroup>

    Save the `conversationId` from the response.
  </Step>

  <Step title="Stream a response">
    <CodeGroup>
      ```bash cURL theme={null}
      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",
          "messages": [{"role": "user", "content": "Hello, how can I reset my password?"}]
        }'
      ```

      ```javascript JavaScript theme={null}
      const res = await fetch("https://platform.agentictrust.com/api/v1/chat/messages", {
        method: "POST",
        headers: {
          "x-api-key": "lum_pk_your_api_key",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          conversationId: "conv_abc123",
          messages: [{ role: "user", content: "Hello, how can I reset my password?" }],
        }),
      });

      const reader = res.body.getReader();
      const decoder = new TextDecoder();
      while (true) {
        const { done, value } = await reader.read();
        if (done) break;
        process.stdout.write(decoder.decode(value));
      }
      ```

      ```python Python theme={null}
      import requests

      res = requests.post(
          "https://platform.agentictrust.com/api/v1/chat/messages",
          headers={"x-api-key": "lum_pk_your_api_key"},
          json={
              "conversationId": "conv_abc123",
              "messages": [{"role": "user", "content": "Hello, how can I reset my password?"}],
          },
          stream=True,
      )

      for chunk in res.iter_content(decode_unicode=True):
          print(chunk, end="")
      ```
    </CodeGroup>

    The response streams back as Server-Sent Events.
  </Step>
</Steps>

## What's next

<CardGroup cols={2}>
  <Card title="Knowledge Base" icon="book" href="/features/knowledge-base">
    Upload documents and crawl websites so the agent answers from your content.
  </Card>

  <Card title="Custom Actions" icon="bolt" href="/features/custom-actions">
    Let the agent call your APIs to take actions on behalf of users.
  </Card>

  <Card title="Widget Configuration" icon="palette" href="/widget/configuration">
    Customize the widget appearance, position, and color scheme.
  </Card>

  <Card title="Identity Verification" icon="shield-check" href="/features/identity">
    Secure your agent with HMAC or JWT identity verification.
  </Card>
</CardGroup>
