---
title: "Stream Agent Message"
method: POST
path: "/api/v1/intelligence/agent/messages/stream"
tags: ["agent", "Agent"]
---

# Stream Agent Message

`POST /api/v1/intelligence/agent/messages/stream`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/intelligence/agent/messages/stream`
- Auth: none declared

Send a message to the agent and stream events via SSE.

Events are flushed as they happen, so the frontend can show
tool execution progress in real time instead of waiting for
the full response.

Event types: text, tool_start, tool_result, error, done

NOTE: ctx.session (from get_async_session via Depends) stays alive for the
full duration of the SSE stream. FastAPI/Starlette only runs dependency
cleanup after the streaming response body is fully consumed.

## Headers

- `Authorization` string

## Request body

- AgentMessageRequest
  - `session_id` string, uuid, nullable
  - `message` string, required
  - `asset_id` string, uuid, nullable
  - `auto_approve` boolean
  - `history` AgentHistoryTurn[], nullable
    - `role` string, required
    - `content` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
