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

# Expose Port Endpoint

> Expose a port from a sandbox

## Rate Limit

20 requests per 60 seconds per IP and token per sandbox.


## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/v1/sandbox/{sandbox_id}/expose
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/sandbox/{sandbox_id}/expose:
    post:
      tags:
        - Sandbox
      summary: Expose Port Endpoint
      description: Expose a port from a sandbox
      operationId: expose_port_endpoint_api_v1_sandbox__sandbox_id__expose_post
      parameters:
        - name: sandbox_id
          in: path
          required: true
          schema:
            type: string
            title: Sandbox Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExposePortRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExposePortResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ExposePortRequest:
      properties:
        port:
          type: integer
          maximum: 9000
          minimum: 22
          title: Port
          description: Port number to expose (22-9000)
        name:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Name
          description: Optional human-readable name for the exposure
        protocol:
          type: string
          title: Protocol
          description: Protocol (HTTP or TCP)
          default: HTTP
      type: object
      required:
        - port
      title: ExposePortRequest
    ExposePortResponse:
      properties:
        exposure_id:
          type: string
          title: Exposure Id
        sandbox_id:
          type: string
          title: Sandbox Id
        port:
          type: integer
          title: Port
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        protocol:
          type: string
          title: Protocol
        url:
          type: string
          title: Url
          description: Public URL for accessing the exposed port
        tls_socket:
          type: string
          title: Tls Socket
        external_port:
          anyOf:
            - type: integer
            - type: 'null'
          title: External Port
          description: External port for TCP exposures (not applicable for HTTP)
        external_endpoint:
          anyOf:
            - type: string
            - type: 'null'
          title: External Endpoint
          description: >-
            External endpoint (host:port) for TCP/UDP exposures (not applicable
            for HTTP)
      type: object
      required:
        - exposure_id
        - sandbox_id
        - port
        - protocol
        - url
        - tls_socket
      title: ExposePortResponse
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````