> ## 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 Ssh Session Endpoint

> Create an SSH session using the SSH sidecar (no sshd required in the sandbox image).

## 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}/ssh-session
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}/ssh-session:
    post:
      tags:
        - Sandbox
      summary: Create Ssh Session Endpoint
      description: >-
        Create an SSH session using the SSH sidecar (no sshd required in the
        sandbox image).
      operationId: create_ssh_session_endpoint_api_v1_sandbox__sandbox_id__ssh_session_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/CreateSSHSessionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSHSessionResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateSSHSessionRequest:
      properties:
        ttl_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Ttl Seconds
          description: >-
            Optional TTL for the SSH session in seconds (max 3600). Defaults to
            900.
      type: object
      title: CreateSSHSessionRequest
    SSHSessionResponse:
      properties:
        session_id:
          type: string
          title: Session Id
        exposure_id:
          type: string
          title: Exposure Id
        sandbox_id:
          type: string
          title: Sandbox Id
        host:
          type: string
          title: Host
        port:
          type: integer
          title: Port
        external_endpoint:
          type: string
          title: External Endpoint
        expires_at:
          type: string
          format: date-time
          title: Expires At
        ttl_seconds:
          type: integer
          title: Ttl Seconds
        gateway_url:
          type: string
          title: Gateway Url
        user_ns:
          type: string
          title: User Ns
        job_id:
          type: string
          title: Job Id
        token:
          type: string
          title: Token
      type: object
      required:
        - session_id
        - exposure_id
        - sandbox_id
        - host
        - port
        - external_endpoint
        - expires_at
        - ttl_seconds
        - gateway_url
        - user_ns
        - job_id
        - token
      title: SSHSessionResponse
    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

````