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

# Get open ports for a process

> Get a list of all open ports for a process



## OpenAPI

````yaml /reference/sandbox-api/openapi.json get /network/process/{pid}/ports
openapi: 3.0.0
info:
  description: API for manipulating filesystem, processes and network.
  title: Sandbox API
  contact: {}
  version: 0.0.1
servers:
  - url: https://{sandbox_host}
    description: >-
      Host from the sandbox's returned url, without the scheme or trailing
      slash.
    variables:
      sandbox_host:
        default: sandbox.example.com
security:
  - BearerAuth: []
paths:
  /network/process/{pid}/ports:
    get:
      tags:
        - network
      summary: Get open ports for a process
      description: Get a list of all open ports for a process
      parameters:
        - description: Process ID
          name: pid
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Object containing PID and array of network.PortInfo
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Invalid process ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Error message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Sandbox access token created through POST /v1/token.

````