# Stream agent events

`GET /v1/projects/{project}/agents/{agent}/events/stream`, operation `agents.StreamAgentEvents`

Streams an agent as it works, as server-sent events: first the transcript's events after after, then each new event as it is added, its answer as it writes it, and the agent whenever it changes.

Reconnect with the last sequence seen as after to miss nothing. The stream lasts until the caller ends it, or 15 minutes, when kosem ends it for the caller to reconnect; a heartbeat arrives after 15 seconds of silence. Skip events you do not know.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `agent` | path | Yes | `string` | The agent's ID. |
| `after` | query | No | `integer (int64)` | The sequence of the last event the caller has seen; the stream starts after it. 0, the default, streams the whole transcript. |

## Responses

### 200

Server-sent events, each one of these; an error event ends a stream that failed after it started.

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.