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

# Get started with XUNA AI Conversational AI

> Build and deploy your first XUNA AI voice agent using the web dashboard, CLI, or API — and embed it on your website in minutes.

XUNA AI Conversational AI lets you create voice agents that handle real conversations. This guide walks you through creating an agent, configuring its behavior, and embedding it on your website — using whichever approach fits your workflow.

<Tabs>
  <Tab title="Dashboard">
    <Steps>
      <Step title="Sign in">
        Go to [xuna.ai](https://xuna.ai) and sign in to your account.
      </Step>

      <Step title="Create an agent">
        Click **Create agent**, enter a name, and select the **Blank** template.
      </Step>

      <Step title="Configure behavior">
        In the **Agent** tab, set the first message and system prompt:

        **First message:**

        ```
        Hi, this is Alexis from <company name> support. How can I help you today?
        ```

        **System prompt:**

        ```
        You are a friendly and efficient virtual assistant for [Your Company Name]. Your role is to assist customers by answering questions about the company's products, services, and documentation.

        Tasks:
        - Answer Questions: Provide clear and concise answers based on the available information.
        - Clarify Unclear Requests: Politely ask for more details if the customer's question is not clear.

        Guidelines:
        - Maintain a friendly and professional tone throughout the conversation.
        - Aim to provide concise answers. Limit responses to a couple of sentences.
        ```
      </Step>

      <Step title="Add a knowledge base">
        In the **Knowledge base** tab, upload documents, paste FAQs, or add URLs. The agent uses these to answer questions accurately.
      </Step>

      <Step title="Choose a voice">
        Open the **Voice** tab and select from 5,000+ voices. Preview voices before saving.
      </Step>

      <Step title="Test the agent">
        Click **Test AI agent** to start a live conversation with your agent directly in the dashboard.
      </Step>

      <Step title="Configure analysis">
        In the **Analysis** tab, add evaluation criteria (for example, `solved_user_inquiry`) and data collection fields (for example, `user_question`). These power conversation analytics after deployment.
      </Step>

      <Step title="Embed on your website">
        Copy your agent ID from the dashboard and add the widget snippet to your HTML:

        ```html theme={null}
        <xuna-ai-convai agent-id="your-agent-id"></xuna-ai-convai>
        <script src="https://unpkg.com/@xuna-ai/convai-widget-embed" async type="text/javascript"></script>
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    <Steps>
      <Step title="Install the CLI">
        ```bash theme={null}
        npm install -g @xuna-ai/cli
        ```
      </Step>

      <Step title="Initialize a project">
        ```bash theme={null}
        xuna-ai agents init
        ```
      </Step>

      <Step title="Authenticate">
        ```bash theme={null}
        xuna-ai auth login
        ```

        Enter your API key when prompted. You can find your key in the [XUNA AI dashboard](https://xuna.ai/app/settings/api-keys).
      </Step>

      <Step title="Create an agent">
        ```bash theme={null}
        xuna-ai agents add "My Assistant" --template assistant
        ```
      </Step>

      <Step title="Deploy the agent">
        ```bash theme={null}
        xuna-ai agents push --agent "My Assistant"
        ```
      </Step>

      <Step title="Generate the embed widget">
        ```bash theme={null}
        xuna-ai agents widget "My Assistant"
        ```

        The command outputs the HTML snippet you need to embed your agent on any website.
      </Step>
    </Steps>
  </Tab>

  <Tab title="API">
    <Steps>
      <Step title="Install the SDK">
        <CodeGroup>
          ```bash Python theme={null}
          pip install xuna-ai python-dotenv
          ```

          ```bash TypeScript theme={null}
          npm install @xuna-ai/xuna-ai-js dotenv
          ```
        </CodeGroup>
      </Step>

      <Step title="Set your API key">
        Create a `.env` file in your project root:

        ```bash .env theme={null}
        XUNA_AI_API_KEY=your_api_key_here
        ```
      </Step>

      <Step title="Define a system prompt">
        <CodeGroup>
          ```python agent.py theme={null}
          prompt = """You are a friendly and efficient virtual assistant for [Your Company Name].
          Your role is to assist customers by answering questions about the company's products,
          services, and documentation. Maintain a professional tone and keep responses concise."""
          ```

          ```typescript agent.ts theme={null}
          const prompt = `You are a friendly and efficient virtual assistant for [Your Company Name].
          Your role is to assist customers by answering questions about the company's products,
          services, and documentation. Maintain a professional tone and keep responses concise.`;
          ```
        </CodeGroup>
      </Step>

      <Step title="Create the agent">
        <CodeGroup>
          ```python agent.py theme={null}
          from dotenv import load_dotenv
          from xuna_ai.client import XunaAI
          import os

          load_dotenv()

          client = XunaAI(api_key=os.getenv("XUNA_AI_API_KEY"))

          response = client.conversational_ai.agents.create(
              name="My voice agent",
              tags=["test"],
              conversation_config={
                  "tts": {
                      "voice_id": "aMSt68OGf4xUZAnLpTU8",
                      "model_id": "xuna_flash_v2"
                  },
                  "agent": {
                      "first_message": "Hi, this is Rachel from [Your Company Name] support. How can I help you today?",
                      "prompt": {"prompt": prompt}
                  }
              }
          )

          print("Agent created with ID:", response.agent_id)
          ```

          ```typescript agent.ts theme={null}
          import { XunaAIClient } from "@xuna-ai/xuna-ai-js";
          import "dotenv/config";

          const client = new XunaAIClient();

          const agent = await client.conversationalAi.agents.create({
              name: "My voice agent",
              tags: ["test"],
              conversationConfig: {
                  tts: {
                      voiceId: "aMSt68OGf4xUZAnLpTU8",
                      modelId: "xuna_flash_v2"
                  },
                  agent: {
                      firstMessage: "Hi, this is Rachel from [Your Company Name] support. How can I help you today?",
                      prompt: { prompt }
                  }
              }
          });

          console.log(`Agent created with ID: ${agent.agentId}`);
          ```
        </CodeGroup>
      </Step>

      <Step title="Embed the agent">
        Use the agent ID returned in the previous step to embed the widget on your website:

        ```html theme={null}
        <xuna-ai-convai agent-id="your-agent-id"></xuna-ai-convai>
        <script src="https://unpkg.com/@xuna-ai/convai-widget-embed" async type="text/javascript"></script>
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Next steps

<CardGroup cols={2}>
  <Card title="Knowledge base" icon="book-open" href="/configure/knowledge-base">
    Upload documents and URLs so your agent answers questions with accurate, grounded information.
  </Card>

  <Card title="Tools" icon="wrench" href="/configure/tools">
    Give your agent the ability to call external APIs, run functions, and take action during conversations.
  </Card>

  <Card title="Authentication" icon="lock" href="/configure/authentication">
    Restrict access to your agent and pass signed user data into conversations.
  </Card>

  <Card title="Conversation analysis" icon="chart-bar" href="/monitor/conversation-analysis">
    Define success criteria and extract structured data from every conversation.
  </Card>
</CardGroup>
