> ## 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.

# List Tunnels Endpoint

> List all active tunnels for the current user.

## Rate Limit

300 requests per 60 seconds per user.


## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json get /api/v1/tunnel
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/tunnel:
    get:
      tags:
        - Tunnel
      summary: List Tunnels Endpoint
      description: List all active tunnels for the current user.
      operationId: list_tunnels_endpoint_api_v1_tunnel_get
      parameters:
        - name: teamId
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Teamid
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by status
            title: Status
          description: Filter by status
        - name: labels
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by labels
            title: Labels
          description: Filter by labels
        - name: includeTerminated
          in: query
          required: false
          schema:
            type: boolean
            description: Include terminated tunnels
            default: false
            title: Includeterminated
          description: Include terminated tunnels
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page
          description: Page number
        - name: perPage
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Items per page
            default: 50
            title: Perpage
          description: Items per page
        - name: sortBy
          in: query
          required: false
          schema:
            type: string
            default: createdAt
            title: Sortby
        - name: sortOrder
          in: query
          required: false
          schema:
            type: string
            default: desc
            title: Sortorder
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TunnelListResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    TunnelListResponse:
      properties:
        tunnels:
          items:
            $ref: '#/components/schemas/TunnelStatusResponse'
          type: array
          title: Tunnels
          description: List of active tunnels
        total:
          type: integer
          title: Total
          description: Total number of tunnels
        page:
          type: integer
          title: Page
          description: Page number
          default: 1
        per_page:
          type: integer
          title: Per Page
          description: Items per page
          default: 50
        has_next:
          type: boolean
          title: Has Next
          description: Whether more pages are available
          default: false
      type: object
      required:
        - total
      title: TunnelListResponse
      description: Response containing list of tunnels.
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    TunnelStatusResponse:
      properties:
        tunnel_id:
          type: string
          title: Tunnel Id
          description: Unique tunnel identifier
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Friendly name if set
        status:
          $ref: '#/components/schemas/TunnelStatus'
          description: Current tunnel status
        hostname:
          type: string
          title: Hostname
          description: Tunnel hostname
        url:
          type: string
          title: Url
          description: Full HTTPS URL
        local_port:
          type: integer
          title: Local Port
          description: Local port forwarded by the tunnel
        labels:
          items:
            type: string
          type: array
          title: Labels
          description: Tunnel labels
        http_user:
          anyOf:
            - type: string
            - type: 'null'
          title: Http User
          description: HTTP basic auth username, if auth is enabled
        auth_enabled:
          type: boolean
          title: Auth Enabled
          description: Whether HTTP basic auth protects tunnel traffic
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Tunnel creation time
        connected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Connected At
          description: When the client connected
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Token expiration time
        terminated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Terminated At
          description: When the tunnel was terminated
        user_id:
          type: string
          title: User Id
          description: Owner user ID
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
          description: Team ID if applicable
      type: object
      required:
        - tunnel_id
        - status
        - hostname
        - url
        - local_port
        - created_at
        - expires_at
        - user_id
      title: TunnelStatusResponse
      description: Response containing tunnel status information.
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
    TunnelStatus:
      type: string
      enum:
        - pending
        - connected
        - disconnected
        - expired
        - terminated
      title: TunnelStatus
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````