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

# Create Tunnel Endpoint

> Create a new tunnel for exposing a local service.

## Rate Limit

100 requests per 60 seconds per user.


## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /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:
    post:
      tags:
        - Tunnel
      summary: Create Tunnel Endpoint
      description: Create a new tunnel for exposing a local service.
      operationId: create_tunnel_endpoint_api_v1_tunnel_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTunnelRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TunnelResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateTunnelRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 64
              minLength: 1
            - type: 'null'
          title: Name
          description: Optional friendly name for the tunnel
        local_port:
          type: integer
          maximum: 65535
          minimum: 1
          title: Local Port
          description: Local port the tunnel will forward traffic to
          default: 8765
        teamId:
          anyOf:
            - type: string
            - type: 'null'
          title: Teamid
          description: Team ID for team tunnels
      type: object
      title: CreateTunnelRequest
      description: Request to create a new tunnel.
    TunnelResponse:
      properties:
        tunnel_id:
          type: string
          title: Tunnel Id
          description: Unique tunnel identifier
        hostname:
          type: string
          title: Hostname
          description: Full hostname for the tunnel
        url:
          type: string
          title: Url
          description: Full HTTPS URL for accessing the tunnel
        frp_token:
          type: string
          title: Frp Token
          description: Authentication token for frpc client
        binding_secret:
          type: string
          title: Binding Secret
          description: Per-tunnel secret for additional authentication via frpc metadata
        server_host:
          type: string
          title: Server Host
          description: frps server hostname
        server_port:
          type: integer
          title: Server Port
          description: frps server port
          default: 7000
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Token expiration timestamp
      type: object
      required:
        - tunnel_id
        - hostname
        - url
        - frp_token
        - binding_secret
        - server_host
        - expires_at
      title: TunnelResponse
      description: Response containing tunnel connection details.
    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

````