> ## Documentation Index
> Fetch the complete documentation index at: https://opensandbox-oc-s-762ac928075c46d2828bcb22.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PTY

> Interactive terminal sessions

Accessed via `sandbox.pty`.

## `sandbox.pty.create(opts?)`

Create an interactive terminal session. [HTTP API →](/api-reference/pty/create)

<ParamField body="cols" type="number" default="80">
  Terminal columns
</ParamField>

<ParamField body="rows" type="number" default="24">
  Terminal rows
</ParamField>

<ParamField body="onOutput" type="(data: Uint8Array) => void">
  Output callback
</ParamField>

**Returns:** `Promise<PtySession>`

***

## PtySession

| Member       | Type     | Description                       |
| ------------ | -------- | --------------------------------- |
| `sessionId`  | `string` | Session ID                        |
| `send(data)` | method   | Send input (string or Uint8Array) |
| `close()`    | method   | Close the PTY                     |
