> ## 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.

# API chat

> Send chat requests through the BehavIQ API.

Chat endpoints:

* `POST /v1/bots/{botId}/chat`
* `POST /v1/bots/{botId}/chat/stream`

Use `GET /v1/bots` first to find a bot ID.

## Standard chat response

```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": "Draft a short script for a tense handover."
  }'
```

Request fields:

* `message` required
* `sessionId`
* `includeCitations`
* `webSearch`
* `useMcp`

## Streaming

Use the SSE endpoint for streamed replies:

```bash theme={null}
curl https://behaviq.io/v1/bots/YOUR_BOT_ID/chat/stream \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Talk me through the first thirty seconds."
  }'
```

That endpoint returns `text/event-stream`.

## Session context

Pass the `sessionId` from the previous response when you want the next request to continue the same conversation.

## Usage

A chat response counts as one request.

For API key traffic:

* credit-balance workspaces use `1` credit per chat response
* enterprise pooled workspaces use included workspace requests first, then credits if available
* enterprise per-user workspaces use credits for API key traffic

Signed-in app usage can also be limited by member request limits.

If the request cannot be covered by included usage, credits, or the relevant caps, the API returns `402`.
