> ## 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 as raw bytes

> Stream the raw bytes of a file from the workspace context repository's default branch on GitHub, with a resolved `Content-Type` header. Used by the file viewer for binary previews (images, PDFs).



## OpenAPI

````yaml https://api.getcargo.io/openapi.json get /context/runtime/raw
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/raw:
    get:
      tags:
        - Context - Runtime
      summary: Read runtime sandbox file as raw bytes
      description: >-
        Stream the raw bytes of a file from the workspace context repository's
        default branch on GitHub, with a resolved `Content-Type` header. Used by
        the file viewer for binary previews (images, PDFs).
      parameters:
        - in: query
          name: path
          schema:
            title: Path
            description: >-
              Repository-relative path of the file to fetch. The response is the
              raw bytes from the configured default branch on GitHub.
            type: string
            minLength: 1
          required: true
          description: >-
            Repository-relative path of the file to fetch. The response is the
            raw bytes from the configured default branch on GitHub.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      reason:
                        title: Error reason
                        type: string
                        const: repositoryNotFound
                    required:
                      - reason
                    additionalProperties: false
                  - type: object
                    properties:
                      reason:
                        title: Error reason
                        type: string
                        const: fileNotFound
                    required:
                      - reason
                    additionalProperties: false
                  - type: object
                    properties:
                      reason:
                        title: Error reason
                        type: string
                        const: tooLarge
                      sizeBytes:
                        title: Size bytes
                        description: >-
                          Underlying file size in bytes. The runtime caps reads
                          at 10 MB.
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                    required:
                      - reason
                      - sizeBytes
                    additionalProperties: false
                  - type: object
                    properties:
                      reason:
                        title: Error reason
                        type: string
                        const: invalidQuery
                    required:
                      - reason
                    additionalProperties: false
                  - type: object
                    properties:
                      reason:
                        title: Error reason
                        type: string
                        const: unknown
                      errorMessage:
                        title: Error message
                        type: string
                    required:
                      - reason
                      - errorMessage
                    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

````