Skip to main content
GET
/
api
/
v1
/
pty
/
{session_id}
Get a PTY session
curl --request GET \
  --url https://{identifier}.sandbox.tensorlake.ai/api/v1/pty/{session_id} \
  --header 'Authorization: Bearer <token>'
{
  "session_id": "<string>",
  "pid": 123,
  "command": "<string>",
  "args": [
    "<string>"
  ],
  "rows": 123,
  "cols": 123,
  "created_at": 123,
  "is_alive": true,
  "ended_at": 123,
  "exit_code": 123,
  "oom_killed": true
}
Get metadata for one PTY session.

Endpoint

GET /api/v1/pty/{session_id}

Example Request

curl https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/pty/<session-id> \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY"

Response

Tensorlake returns 200 OK:
{
  "session_id": "LYtJOrxE9Kz3bphPUDzuX",
  "pid": 42,
  "command": "/bin/bash",
  "args": ["-l"],
  "rows": 24,
  "cols": 80,
  "created_at": 1710000000000,
  "ended_at": null,
  "exit_code": null,
  "is_alive": true
}
The PTY token is not returned from this endpoint. If the kernel OOM killer terminated the PTY process, the response includes oom_killed: true. If the session does not exist, Tensorlake returns 404 Not Found.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string
required

The PTY session identifier.

Response

PTY session metadata

session_id
string
required
pid
integer<int32>
required
command
string
required
args
string[]
required
rows
integer<int32>
required
cols
integer<int32>
required
created_at
integer<int64>
required
is_alive
boolean
required
ended_at
integer<int64> | null
exit_code
integer<int32> | null
oom_killed
boolean

Included only when the kernel OOM killer terminated the PTY process.