---
title: "Read runtime sandbox file as raw bytes"
method: GET
path: "/context/runtime/raw"
tags: ["Context - Runtime"]
---

# Read runtime sandbox file as raw bytes

`GET /context/runtime/raw`

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

## Query parameters

- `path` string, required — Repository-relative path of the file to fetch. The response is the raw bytes from the configured default branch on GitHub.

## Response `200`

Successful response

- union
  - object
    - `reason` 'repositoryNotFound', required
  - object
    - `reason` 'fileNotFound', required
  - object
    - `reason` 'tooLarge', required
    - `sizeBytes` integer, required — Underlying file size in bytes. The runtime caps reads at 10 MB.
  - object
    - `reason` 'invalidQuery', required
  - object
    - `reason` 'unknown', required
    - `errorMessage` string, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

---

[API](https://skmtc.net/getcargo/apis/cargo-api.md) · [All operations](https://skmtc.net/getcargo/apis/cargo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getcargo/cargo-api/revisions/1d5a19e01d83/schema)
