---
title: "Read file"
method: GET
path: "/api/fs/read/*"
tags: ["filesystem"]
---

# Read file

`GET /api/fs/read/*`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/fs/read/*`
- Auth: none required

Stream one file relative to the requested location with ETag, Last-Modified, and single-range HTTP Range support (206 Partial Content, 416 Range Not Satisfiable, and 304 Not Modified; multi-range and malformed Range headers fall back to 200).

## Query parameters

- `location` object, nullable
  - `directory` string, nullable

## Response `200`

Success

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: FileNotFoundError | LocationNotFoundError

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
