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

# Getting started

1. Create an API key in the app.
2. List the available bots.
3. Send one chat request.
4. Check workspace usage.

## 1. Create an API key

In the app, go to `Settings -> API Access` and create a key for the workspace you want to use.

Keys are only shown once. Save the value when it appears.

## 2. List bots

```bash theme={null}
curl https://behaviq.io/v1/bots
```

Pick the `id` of the bot you want to use.

## 3. Send a chat request

```bash theme={null}
curl https://behaviq.io/v1/bots/YOUR_BOT_ID/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Write a short de-escalation script for a tense customer interaction."
  }'
```

The response includes `sessionId`, `responseId`, and `text`.

## 4. Keep the conversation going

Reuse the same `sessionId` in later requests if you want context carried forward.

```bash theme={null}
curl https://behaviq.io/v1/bots/YOUR_BOT_ID/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sessionId": "YOUR_SESSION_ID",
    "message": "Make that a little calmer."
  }'
```

## 5. Check usage

```bash theme={null}
curl https://behaviq.io/v1/usage \
  -H "Authorization: Bearer YOUR_API_KEY"
```

The response includes the current period, request count, TTS count, and credit balance when the workspace uses credits.

For chat request details, see [API chat](/api-chat). The generated API reference is available in the sidebar.
