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

# Quickstart

> Get started with Thunder in 5 minutes

## Prerequisites

* A Thunder account
* An API key (see [Authentication](/authentication))

## Step 1: Get Your API Key

API keys are used to authenticate all requests to the Thunder API. You'll need to create one from the Thunder dashboard or via the API.

```bash theme={null}
# Your API key will look something like this
x-api-key: tk_live_abc123def456...
```

## Step 2: Ingest Your First Conversation

Send conversation messages to Thunder using the Ingest API:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.usethunder.com/v1/ingest \
    -H "Content-Type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -d '{
      "messages": [
        {
          "role": "user",
          "content": "How do I reset my password?",
          "userId": "user_123"
        },
        {
          "role": "assistant",
          "content": "You can reset your password by clicking the Forgot Password link on the login page.",
          "userId": "assistant"
        }
      ]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.usethunder.com/v1/ingest', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': 'YOUR_API_KEY',
    },
    body: JSON.stringify({
      messages: [
        {
          role: 'user',
          content: 'How do I reset my password?',
          userId: 'user_123',
        },
        {
          role: 'assistant',
          content: 'You can reset your password by clicking the Forgot Password link on the login page.',
          userId: 'assistant',
        },
      ],
    }),
  })

  const data = await response.json()
  console.log(data)
  // { instanceId: "...", sessionId: "..." }
  ```

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

  response = requests.post(
      'https://api.usethunder.com/v1/ingest',
      headers={
          'Content-Type': 'application/json',
          'x-api-key': 'YOUR_API_KEY',
      },
      json={
          'messages': [
              {
                  'role': 'user',
                  'content': 'How do I reset my password?',
                  'userId': 'user_123',
              },
              {
                  'role': 'assistant',
                  'content': 'You can reset your password by clicking the Forgot Password link on the login page.',
                  'userId': 'assistant',
              },
          ],
      },
  )

  print(response.json())
  # { "instanceId": "...", "sessionId": "..." }
  ```
</CodeGroup>

The response includes the `instanceId` and `sessionId` that were created (or used if you provided them). Store these IDs on your end - you'll need them for future ingestion requests to the same session and for querying metrics.

## Step 3: Add More Messages to the Session

To continue an existing conversation, include the `sessionId` from the previous response:

```bash theme={null}
curl -X POST https://api.usethunder.com/v1/ingest \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "instanceId": "550e8400-e29b-41d4-a716-446655440000",
    "sessionId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "messages": [
      {
        "role": "user",
        "content": "Thanks, that worked!",
        "userId": "user_123"
      }
    ]
  }'
```

## Step 4: Query Your Metrics

Once Thunder has processed your conversations, you can query metrics:

```bash theme={null}
curl "https://api.usethunder.com/v1/query?groupBy=TOPIC&instanceId=550e8400-e29b-41d4-a716-446655440000&dateRange.start=2024-01-01T00:00:00Z&dateRange.end=2024-01-31T23:59:59Z&timeGranularity=DAY&fields=sessions,users,messages" \
  -H "x-api-key: YOUR_API_KEY"
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Gaps" icon="circle-question" href="/features/gaps">
    Find unanswered questions and missing capabilities
  </Card>

  <Card title="Topics" icon="tags" href="/features/topics">
    See what users are talking about
  </Card>

  <Card title="Querying Metrics" icon="chart-bar" href="/guides/querying-metrics">
    Learn query patterns and filters
  </Card>

  <Card title="API Overview" icon="book" href="/api-reference/overview">
    Understand API conventions
  </Card>
</CardGroup>
