> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List PTY Sessions

> List the PTY sessions tracked inside a sandbox.

List the PTY sessions tracked inside a sandbox.

## Endpoint

```http theme={null}
GET /api/v1/pty
```

## Example Request

```bash theme={null}
curl https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/pty \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY"
```

## Response

Tensorlake returns `200 OK`:

```json theme={null}
{
  "sessions": [
    {
      "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 included in list responses. If the kernel OOM killer terminated a PTY process, that session includes `oom_killed: true`.


## OpenAPI

````yaml get /api/v1/pty
openapi: 3.1.0
info:
  title: Tensorlake API
  description: >-
    Tensorlake Cloud APIs for Sandboxes, Document Ingestion, and Serverless
    Workflows
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.tensorlake.ai/
security:
  - bearerAuth: []
tags:
  - name: Tensorlake Cloud API
    description: >-
      Tensorlake Cloud APIs for Sandboxes, Document Ingestion, and Serverless
      Workflows
paths:
  /api/v1/pty:
    servers:
      - url: https://{identifier}.sandbox.tensorlake.ai
        description: >-
          Example sandbox proxy host for a specific running sandbox. For
          programmatic access, use the sandbox's `ingress_endpoint`.
        variables:
          identifier:
            default: example-sandbox
            description: The sandbox ID or sandbox name.
    get:
      tags:
        - sandbox-pty
      summary: List PTY sessions
      description: List the PTY sessions tracked inside a sandbox.
      operationId: sandbox_pty_list
      responses:
        '200':
          description: List of PTY sessions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxPtyListResponse'
components:
  schemas:
    SandboxPtyListResponse:
      type: object
      required:
        - sessions
      properties:
        sessions:
          type: array
          items:
            $ref: '#/components/schemas/SandboxPtySessionInfo'
    SandboxPtySessionInfo:
      type: object
      required:
        - session_id
        - pid
        - command
        - args
        - rows
        - cols
        - created_at
        - is_alive
      properties:
        session_id:
          type: string
        pid:
          type: integer
          format: int32
        command:
          type: string
        args:
          type: array
          items:
            type: string
        rows:
          type: integer
          format: int32
        cols:
          type: integer
          format: int32
        created_at:
          type: integer
          format: int64
        ended_at:
          type:
            - integer
            - 'null'
          format: int64
        exit_code:
          type:
            - integer
            - 'null'
          format: int32
        is_alive:
          type: boolean
        oom_killed:
          type: boolean
          description: Included only when the kernel OOM killer terminated the PTY process.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````