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

# Quickstart for Usage

> Get started with Headless Agents in minutes

## Getting Started

Follow these steps to start using Headless Agents in your application.

### 1. Get Your API Key

<AccordionGroup>
  <Accordion icon="key" title="Create an account">
    Sign up for a Headless Agents account at [headlessagents.ai](https://headlessagents.ai).
    Once registered, you'll be able to access api keys on the [profile page](https://headlessagents.ai/profile).
  </Accordion>

  <Accordion icon="lock" title="Generate API Key">
    1. Navigate to the API Keys section in your dashboard
    2. Click "Create New API Key"
    3. Save your API key securely - you won't be able to see it again!

    ```bash
    # Example of using your API key
    curl -H "X-API-Key: your_api_key" https://api.headlessagents.ai/health
    ```
  </Accordion>
</AccordionGroup>

### 2. Make Your First API Call

<AccordionGroup>
  <Accordion icon="heart-pulse" title="Test the connection">
    Start by testing the health check endpoint to ensure everything is working:

    ```bash
    curl https://api.headlessagents.ai/health
    ```

    You should receive:

    ```json
    {
      "status": "healthy"
    }
    ```
  </Accordion>

  <Accordion icon="message-bot" title="Call an agent">
    Now let's make your first call to an agent:

    ```bash
    curl -X POST \
      -H "X-API-Key: your_api_key" \
      -H "Content-Type: application/json" \
      -d '{"request": "Hello, how are you?"}' \
      https://api.headlessagents.ai/call/your_agent_id
    ```

    You should receive a response like:

    ```json
    {
      "thread_id": "50cc9455b84d48ffad6b4c9fd41b561e",
      "conversation_id": "bc8e506e4a6f49ad",
      "agent_id": "your_agent_id",
      "success": true,
      "response": "Hi there! How can I help you today?",
      "function_result": null
    }
    ```
  </Accordion>
</AccordionGroup>

### 3. Integration Examples

<CardGroup>
  <Card title="Python" icon="python">
    ```python
    import requests

    API_KEY = 'your_api_key'
    AGENT_ID = 'your_agent_id'

    response = requests.post(
        f'https://api.headlessagents.ai/call/{AGENT_ID}',
        headers={'X-API-Key': API_KEY},
        json={'request': 'Hello!'}
    )
    print(response.json())
    ```
  </Card>

  <Card title="JavaScript" icon="js">
    ```javascript
    const response = await fetch(
      `https://api.headlessagents.ai/call/${agentId}`,
      {
        method: 'POST',
        headers: {
          'X-API-Key': 'your_api_key',
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          request: 'Hello!'
        }),
      }
    );
    const data = await response.json();
    ```
  </Card>
</CardGroup>

## Next Steps

Now that you've made your first API call, explore these resources to learn more:

<CardGroup>
  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Explore all available API endpoints and features
  </Card>

  <Card title="View Statistics" icon="chart-line" href="/api-reference/endpoint/stats">
    Learn how to monitor your agent's performance
  </Card>
</CardGroup>
