Skip to main content
Each thread has isolated file storage accessible via these endpoints. Files are stored in the thread’s SQLite database with support for external references (URLs, S3, R2).

File paths in URLs

{path} is the file’s path in the thread file system without its leading /, with each path segment percent-encoded. The path of an attachment is such a path, so encode each segment before placing it in a URL:
The file /my dir/a file.txt is served at /api/threads/{threadId}/fs/my%20dir/a%20file.txt. getFileUrl() in @standardagents/client, @standardagents/react, and @standardagents/vue encodes paths this way. The server decodes each segment separately, for reads, writes, and deletes. An encoded slash (%2F) inside a segment is not a path separator, and no file name contains a slash. A path with such a segment or with a malformed escape (for example a bare %) names no file: a read or delete returns 404, and a write returns 400.

List Directory / Query Files

string
required
The thread identifier
boolean
Return storage statistics instead of file list
string
Full-text search pattern
string
Glob pattern for path matching (e.g., *.jpg)

Get File

string
required
The thread identifier
string
required
File path (e.g., attachments/photo.jpg)
boolean
Return image thumbnail instead of full file
string
Set to json to return metadata only
Returns binary file data with appropriate Content-Type header, or JSON metadata when format=json.

Write File

string
required
The thread identifier
string
required
File path to write
string
Base64-encoded file data
string
MIME type of the file
object
Optional custom metadata
number
Image width in pixels (for images)
number
Image height in pixels (for images)
string
Base64-encoded thumbnail for images
string
Set to "directory" to create a directory
string
External URL for linked files (instead of data)
Large files (>1.75MB) are automatically chunked server-side. No special client handling is required—just send a normal POST request with the binary data.

Delete File

string
required
The thread identifier
string
required
File or directory path to delete
Returns 204 No Content on success. Directories must be empty to delete.

FileRecord Schema