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

# Upload a file into a session's sandbox

> Creates or replaces one file under `/workspace` with the request body (at most 32 MiB; larger files are out of scope: fetch them from inside the sandbox with exec). Missing parent directories are created; symlinks are resolved and the target must stay under `/workspace`. The file is owned by the agent user. Allowed while the session is `ready`. Recorded as `session.file_write` (path and size).



## OpenAPI

````yaml /api-reference/openapi.json put /v1/sessions/{session_id}/files/content
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}/files/content:
    put:
      tags:
        - Sessions
      summary: Upload a file into a session's sandbox
      description: >-
        Creates or replaces one file under `/workspace` with the request body
        (at most 32 MiB; larger files are out of scope: fetch them from inside
        the sandbox with exec). Missing parent directories are created; symlinks
        are resolved and the target must stay under `/workspace`. The file is
        owned by the agent user. Allowed while the session is `ready`. Recorded
        as `session.file_write` (path and size).
      operationId: write_file
      parameters:
        - name: session_id
          in: path
          description: Session ID
          required: true
          schema:
            type: string
        - name: path
          in: query
          description: |-
            Absolute path under /workspace (listing default: /workspace). Other
            query parameters (`list=1`) are accepted and ignored: a directory is
            always listed.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: array
              items:
                type: integer
                format: int32
                minimum: 0
        required: true
      responses:
        '200':
          description: Written
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionFileWritten'
        '400':
          description: Path outside /workspace, a directory, or session ops disabled
        '404':
          description: Not found in this workspace
        '409':
          description: The session is not ready
        '413':
          description: The body is larger than 32 MiB
      security:
        - bearerAuth: []
components:
  schemas:
    SessionFileWritten:
      type: object
      required:
        - object
        - path
        - bytes
      properties:
        object:
          type: string
        path:
          type: string
          description: The resolved path written.
        bytes:
          type: integer
          minimum: 0
  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.