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

# Open an interactive shell in a session's sandbox

> Returns a single-use WebSocket URL, valid for 60 seconds, that opens a login shell (`bash`, in a pseudo-terminal) as the sandbox's agent user in `/workspace`. `veri sessions attach` uses it. The shell's traffic goes through the session's egress rules. While a shell is attached the session stays awake (and bills); a shell idle for 30 minutes is closed. The runtime records `session.attach` and `session.detach` on the transcript. Allowed while the session is `ready`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sessions/{session_id}/attach-token
openapi: 3.1.0
info:
  title: Veri API
  description: >-
    REST API for the Veri RL post-training platform. All requests require a
    Bearer API key (`vk_` prefix).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.veri.studio
    description: Production
security: []
tags:
  - name: Training jobs
    description: Create, monitor, and manage training jobs.
  - name: Datasets
    description: Upload and connect training datasets.
  - name: Deployments
    description: Serve trained models and run inference.
  - name: Volumes
    description: Persistent file storage mounted into jobs.
  - name: Models
    description: Custom model registry deployments serve from.
  - name: Regions
    description: Discover available launch regions.
  - name: GPU
    description: Live GPU availability by provider and region.
  - name: Code artifacts
    description: Upload custom training script bundles.
  - name: Billing
    description: Credit balance and transaction history.
  - name: API keys
    description: Create and revoke API keys.
  - name: Account
    description: The authenticated caller's identity.
  - name: Settings
    description: Account-level integrations (Weights & Biases).
  - name: Metrics
    description: Prometheus metrics export for your own observability stack.
  - name: Evaluators
    description: 'Evaluators: versioned scoring rules (LLM judge, code, human).'
  - name: Experiments
    description: >-
      Experiments: offline runs of a pinned dataset snapshot through a target,
      scored by pinned evaluators.
  - name: Annotation queues
    description: >-
      Human review: queue traces, threads and experiment items, reserve one at a
      time, score them and feed corrections back into datasets.
  - name: Monitors
    description: >-
      Monitors: evaluators scoring a sampled share of a deployment's live
      traffic.
  - name: Observability
    description: Agent conversations, agents and their traffic.
  - name: Public runs
    description: Unauthenticated reads of runs their owners published to Explore.
paths:
  /v1/sessions/{session_id}/attach-token:
    post:
      tags:
        - Sessions
      summary: Open an interactive shell in a session's sandbox
      description: >-
        Returns a single-use WebSocket URL, valid for 60 seconds, that opens a
        login shell (`bash`, in a pseudo-terminal) as the sandbox's agent user
        in `/workspace`. `veri sessions attach` uses it. The shell's traffic
        goes through the session's egress rules. While a shell is attached the
        session stays awake (and bills); a shell idle for 30 minutes is closed.
        The runtime records `session.attach` and `session.detach` on the
        transcript. Allowed while the session is `ready`.
      operationId: attach_token
      parameters:
        - name: session_id
          in: path
          description: Session ID
          required: true
          schema:
            type: string
      responses:
        '201':
          description: The URL to connect to
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionAttachToken'
        '400':
          description: Session ops disabled
        '404':
          description: Not found in this workspace
        '409':
          description: The session is not ready
        '501':
          description: The sandbox runtime does not support attach
      security:
        - bearerAuth: []
components:
  schemas:
    SessionAttachToken:
      type: object
      required:
        - object
        - ws_url
        - expires_at
      properties:
        object:
          type: string
        ws_url:
          type: string
          description: >-
            Connect a WebSocket here within 60 s; it works once. Add

            `&cols=..&rows=..` for the terminal size. Binary frames are stdin /

            stdout; a text frame `{"type":"resize","cols":..,"rows":..}`
            resizes.
        expires_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: API key with the `vk_` prefix. Create one from the dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.