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

# Read runtime sandbox file

> Read a UTF-8 file from the workspace runtime sandbox. Returns the file content.



## OpenAPI

````yaml https://api.getcargo.io/openapi.json post /context/runtime/content
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /context/runtime/content:
    post:
      tags:
        - Context - Runtime
      summary: Read runtime sandbox file
      description: >-
        Read a UTF-8 file from the workspace runtime sandbox. Returns the file
        content.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  minLength: 1
                  title: Path
                  description: >-
                    Path of the file to read in the runtime sandbox, relative to
                    the workspace working directory.
                startLine:
                  title: Start line
                  description: >-
                    1-indexed inclusive line at which to start reading. Defaults
                    to the first line of the file.
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                endLine:
                  title: End line
                  description: >-
                    1-indexed inclusive line at which to stop reading. Defaults
                    to the last line of the file. Must be greater than or equal
                    to `startLine` when both are provided.
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
              required:
                - path
              additionalProperties: false
              title: Request body
              description: Read a file from the workspace runtime sandbox.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  path:
                    type: string
                    title: Path
                  content:
                    type: string
                    title: Content
                    description: UTF-8 decoded content of the requested line range.
                  startLine:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    title: Start line
                    description: >-
                      1-indexed inclusive start line of the returned slice
                      (after clamping to the file's bounds).
                  endLine:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    title: End line
                    description: >-
                      1-indexed inclusive end line of the returned slice. Equals
                      `startLine - 1` when the requested range starts past the
                      end of the file.
                  totalLines:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    title: Total lines
                    description: Total number of lines in the underlying file.
                required:
                  - path
                  - content
                  - startLine
                  - endLine
                  - totalLines
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````