---
title: "Connect to a persistent PTY"
method: GET
path: "/api/experimental/persistent-pty/{ptyID}/connect"
tags: ["persistentPty"]
---

# Connect to a persistent PTY

`GET /api/experimental/persistent-pty/{ptyID}/connect`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/experimental/persistent-pty/{ptyID}/connect`
- Auth: none required

Stream persistent PTY output through the OpenCode server.

## Path parameters

- `ptyID` string, required

## Query parameters

- `cursor` string
- `role` string
- `attachment_id` string
- `takeover` string
- `input_protocol` string
- `ticket` string

## Response `200`

Success

- boolean

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: PtyNotFoundError
- `503`: ServiceUnavailableError

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-28** `079d83620443`: 1 info
  - api operation id `persistentPty.connect` removed and replaced with `experimental.persistentPty.connect`

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/experimental/persistent-pty/:ptyID/connect/get.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
