---
title: "Send Chat Message"
method: POST
path: "/api/assistant/chat"
tags: ["Assistant"]
---

# Send Chat Message

`POST /api/assistant/chat`

Send a message to the AI assistant and receive a response. Supports both streaming (SSE) and non-streaming responses.

## Query parameters

- `entityType` string
- `entityId` string

## Request body

- object
  - `msg` string
  - `sessionId` string

## Response `200`

AI assistant response messages

- ModelMessage[]
  - `id` string — The unique identifier for the message. Not required.
  - `role` string — Indicates who authored the message. Either `user` or `assistant`.
  - `stop_reason` string — The reason the message was stopped.
  - `stop_sequence` string — The sequence in which the message was stopped.
  - `thoughts` string — The plain text thoughts from the model's response
  - `usage` ModelUsage — Usage statistics after deducting the costs of the message.
    - `credits` integer — The number of credits remaining after this message.
    - `input_tokens` integer — The number of input tokens used.
    - `output_tokens` integer — The number of output tokens used.

## Other responses

- `400` — The provided input object or parameters are malformed or invalid
- `401` — Request was not properly authenticated
- `403` — Insufficient permissions for this request
- `500` — Internal SOC error; review SOC logs

---

[API](https://skmtc.net/security-onion-solutions/apis/security-onion-connect-api.md) · [All operations](https://skmtc.net/security-onion-solutions/apis/security-onion-connect-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/security-onion-solutions/security-onion-connect-api/revisions/0576ce393f8d/schema)
