# Terminals

Pseudo-terminal sessions — create, resize, remove, and the upgrade endpoint that attaches to one.

Playground

Send these requests to your own running server. Values stay in this browser.

Not connected

Base URL  Directory _optional_  Bearer token _optional_ 

 

How this works

Start a server with `nikcli serve --hostname 127.0.0.1 --port 4096`. Requests go straight from this page to that address — the browser allows it because loopback counts as a secure origin, and the server allows it because `nikcli-ai.dev` is in its CORS allowlist.

To try things without touching your real sessions or config, start the server with `NIKCLI_TEST_HOME` pointed at a throwaway directory — see [the guided tour](/docs/guides/api-tour).

## Operations

6 endpoints, generated from the server's own [OpenAPI document](/docs/api). Every path also accepts the `directory` and `workspace` query parameters that select which instance handles the request.

<table class="api-index not-prose"><tbody><tr><td class="api-index-method"><span class="api-method api-method-get">get</span></td><td><a href="#op-get-pty">/pty</a></td><td class="api-index-id">pty.list</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-pty">/pty</a></td><td class="api-index-id">pty.create</td></tr><tr><td class="api-index-method"><span class="api-method api-method-get">get</span></td><td><a href="#op-get-pty-ptyID">/pty/{ptyID}</a></td><td class="api-index-id">pty.get</td></tr><tr><td class="api-index-method"><span class="api-method api-method-put">put</span></td><td><a href="#op-put-pty-ptyID">/pty/{ptyID}</a></td><td class="api-index-id">pty.update</td></tr><tr><td class="api-index-method"><span class="api-method api-method-delete">delete</span></td><td><a href="#op-delete-pty-ptyID">/pty/{ptyID}</a></td><td class="api-index-id">pty.remove</td></tr><tr><td class="api-index-method"><span class="api-method api-method-get">get</span></td><td><a href="#op-get-pty-ptyID-connect">/pty/{ptyID}/connect</a></td><td class="api-index-id">pty.connect</td></tr></tbody></table>

get /pty [#](#op-get-pty) `pty.list`

Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| directory | query | string | optional |
| workspace | query | string | optional |

Responses

200 PtyList application/json

[Pty\_1](#schema-Pty_1)\[\]

Example response captured

```
[]
```

SDK example

pty.list

ts 

1

2

3

4

5

6

```
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.pty.list({
  ...
})
```

Try it

directory _query_  workspace _query_

---

Source: https://nikcli-ai.dev/docs/api/pty
