# Stream run events

> Server-sent events while a run works.

`GET https://api.agent.clatterlabs.xyz/v1/runs/{id}/events` (key permission: `runs:read`)

Server-sent events while the run works: `status` when it changes, one `step` per agent message or tool call, then `done` with the final run. One connection lasts up to 10 minutes; reconnect with `?after=N` to continue.

## Authorizations

- `Authorization` (string, required): Your API key as a bearer token: `Bearer clsk_...`. Create keys in the [Console](https://console.clatterlabs.com/api-keys).
- `X-Clatter-Account` (string, required): The Account ID that owns the key, like `CL-7K2M9QXA`. Find it in Console › Settings. A missing value answers `401 missing_account_id`; someone else's answers `401 account_mismatch`.

## Path parameters

- `id` (string, required): The run id.

## Query parameters

- `after` (integer, default 0): Skip the first N steps (the number of `step` events you already have).

## Response

- `event: status` ({ status }): The run's status changed: `queued`, `running`, `completed`, `failed` or `cancelled`.
- `event: step` (Step): One agent step.
- `event: done` (Run): The finished run, same shape as [Get a run](/api-reference/runs/get).
- `event: timeout` ({ message, after }): The 10-minute connection limit was reached; the run continues. Reconnect with `?after=` set to `after`.
- `event: error` ({ code, message }): The stream stopped (for example the key was revoked). Reconnect with `?after=N`.

## Example request

```bash
curl -N "https://api.agent.clatterlabs.xyz/v1/runs/RUN_ID/events" \
  -H "Authorization: Bearer $CLATTER_API_KEY" \
  -H "X-Clatter-Account: $CLATTER_ACCOUNT_ID"
```

## Example response

```text
event: status
data: {"status":"running"}

event: step
data: {"index":0,"type":"message","text":"I'll write hello.py and run it."}

event: step
data: {"index":1,"type":"tool","name":"computer_files","ok":true,"args":"{\"path\":\"hello.py\"}","output":"wrote 61 bytes"}

event: done
data: {"id":"4f0c2a6e-…","object":"run","status":"completed","output":"…"}
```

See [Streaming events](/agent/streaming) for a full client with reconnection.
