---
title: "Stream an agent computer terminal – Superbot API"
canonical_url: "https://superbot.gg/developers/devices/streamAgentTerminal"
summary: "Server-sent events, every frame `event: terminal` with an AgentTerminalFrame as JSON: `output` (seq strictly increasing), then `exit` or `gone`, after which the stream closes. Resume with `since=<seq>` (or Last-Event-ID). Open a terminal with a `bash` job `{command: <login shell>, runInBackground: true, interactive: true}` (a real tty: prompts, sudo and TUIs work) and type into it with `bash_write`."
---

> Markdown of https://superbot.gg/developers/devices/streamAgentTerminal. Site index: /llms.txt.

# Stream an agent computer terminal

`GET /v1/devices/{device_id}/terminals/{terminal_id}/stream`

Server-sent events, every frame `event: terminal` with an AgentTerminalFrame as JSON: `output` (seq strictly increasing), then `exit` or `gone`, after which the stream closes. Resume with `since=<seq>` (or Last-Event-ID). Open a terminal with a `bash` job `{command: <login shell>, runInBackground: true, interactive: true}` (a real tty: prompts, sudo and TUIs work) and type into it with `bash_write`.

- Operation id: `streamAgentTerminal`
- Group: [Devices](https://superbot.gg/developers/devices.md)
- Auth: A caller key holding `devices:read` (`Authorization: Bearer sbc_…` or `x-api-key: sbc_…`), or a signed-in session.
- Scopes: `devices:read`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `device_id` | string | required | An agent computer (`agt_…`) on your account. |
| `terminal_id` | string | required | The terminal id a background `bash` job answered. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `since` | string | optional | Resume after this output seq (a byte cursor). Absent: from the start of the buffer. |

## Response 200

The terminal stream.

`text/event-stream`: string.

## Errors

Every refusal carries `error`, `message`, `doc_url` and `request_id`; the gateway routes answer in the dialect you dialed.

| Status | Codes | When |
| --- | --- | --- |
| 400 | [`invalid_request`](https://superbot.gg/developers#errors-invalid_request) | The request is malformed or a parameter is invalid; `param` names the field. |
| 401 | [`unauthorized`](https://superbot.gg/developers#errors-unauthorized) | The bearer is missing, malformed or unknown. |
| 403 | [`insufficient_scope`](https://superbot.gg/developers#errors-insufficient_scope) | The key lacks a scope (insufficient_scope), is revoked, or may not call this route. |
| 404 | [`not_found`](https://superbot.gg/developers#errors-not_found) | No such resource on this account. |

## Examples

```sh
curl -sS -X GET "https://superbot.gg/v1/devices/$DEVICE_ID/terminals/$TERMINAL_ID/stream" \
  -H "Authorization: Bearer $SUPERBOT_API_KEY"
```

```js
const deviceId = 'DEVICE_ID';
const terminalId = 'TERMINAL_ID';
const res = await fetch(`https://superbot.gg/v1/devices/${deviceId}/terminals/${terminalId}/stream`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

```python
import os
import requests

device_id = "DEVICE_ID"
terminal_id = "TERMINAL_ID"
res = requests.request(
    "GET",
    f"https://superbot.gg/v1/devices/{device_id}/terminals/{terminal_id}/stream",
    headers={
        "Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
    },
)
print(res.status_code, res.json())
```
