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

# Stream Agent Events

> Stream assistant replies and intermediate deltas for an agent session using Server-Sent Events. Ideal for real-time chat UIs.

This endpoint accepts the same payload as the non-streaming create event endpoint but returns a `text/event-stream` response. You receive delta tokens, turn boundaries, and completion signals as individual SSE events.

## Endpoint

```http theme={null}
POST /v1/agents/sessions/{session_id}/events/stream
```

## Authentication

Pass one of `Authorization: Bearer <api-key>` or `Authorization: ApiKey <key>`.

## Path Parameters

<ParamField path="session_id" type="string" required>
  The agent session identifier.
</ParamField>

## Request Body

<ParamField body="role" type="string" required>
  The event role. Use `user` for messages or `tool` for tool results.
</ParamField>

<ParamField body="content" type="string">
  Text content of the message. Required when role is `user`.
</ParamField>

<ParamField body="tool_calls" type="array">
  Array of tool call objects emitted by the model.
</ParamField>

<ParamField body="tool_call_results" type="array">
  Array of tool call result objects returned to the model.
</ParamField>

## Response

The response is `text/event-stream`. Each line is an SSE event. Common event types include `delta` for content fragments and `turn.completed` when a model turn finishes.

<RequestExample>
  ```bash cURL theme={null}
  curl -N -X POST https://agent.example.com/v1/agents/sessions/sess_01J5X8/events/stream \
    -H "Authorization: Bearer <api-key>" \
    -H "Content-Type: application/json" \
    -H "Accept: text/event-stream" \
    -d '{
      "role": "user",
      "content": "Explain quantum computing"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```text/event-stream 200 theme={null}
  event: delta
  data: {"content":"Quantum"}

  event: delta
  data: {"content":" computing"}

  event: delta
  data: {"content":" is..."}

  event: turn.completed
  data: {}
  ```
</ResponseExample>


## Related topics

- [Create Agent Event](/api-reference/agent/events/create.md)
- [Get Agent Turn](/api-reference/agent/turns/get.md)
- [List Agent Turns](/api-reference/agent/turns/list.md)
- [Create Aria Agent Cloud Session for an Agent](/api-reference/agent/sessions/create.md)
- [List Session Items](/api-reference/agent/items/list.md)
