Kubi Docs
Kubi API

Copy files to and from a screen, list folders.


Download a file

GET
https://api.trykubi.com/v1
/screens/{screen_id}/files
Bearer (API key)

Needs the exec permission. Answers within 28 s.

Returns the file at path as bytes. Up to 64 MiB. Needs exec (a screen holds logins and keys). The hosted MCP's read_file wraps it for files up to 64 KiB.

Download a file › path Parameters

screen_id
​string · maxLength: 24 · pattern: ^scr_[0-9a-z]{20}$ · required

Screen id (scr_...).

Download a file › query Parameters

path
​string · minLength: 1 · maxLength: 1024 · required

Absolute path on the screen, or relative to /home/user.

Download a file › Headers

Kubi-Run
​string · maxLength: 100 · pattern: ^[ -~]{1,100}$

Optional label that groups calls into one run in the screen's history. It is only a label and never locks the screen. The SDK fills it from KUBI_RUN, else Claude Code's CLAUDE_CODE_SESSION_ID, else one id per client it creates.

Download a file › Responses

Success.

string · binary · maxLength: 67108864

Upload a file

PUT
https://api.trykubi.com/v1
/screens/{screen_id}/files
Bearer (API key)

Needs the exec permission. Answers within 28 s.

Writes the request body to path on the screen as the desktop user, creating folders. Replaces an existing file. Up to 64 MiB; bigger files go through exec (curl, git) for now. The 28 s limit counts our work after the body has arrived, not your upload time. The hosted MCP's write_file wraps it for files up to 64 KiB.

Upload a file › path Parameters

screen_id
​string · maxLength: 24 · pattern: ^scr_[0-9a-z]{20}$ · required

Screen id (scr_...).

Upload a file › query Parameters

path
​string · minLength: 1 · maxLength: 1024 · required

Absolute path on the screen, or relative to /home/user.

mode
​string · maxLength: 4 · pattern: ^[0-7]{3,4}$

Octal permissions.

Default: 0644

Upload a file › Headers

Kubi-Run
​string · maxLength: 100 · pattern: ^[ -~]{1,100}$

Optional label that groups calls into one run in the screen's history. It is only a label and never locks the screen. The SDK fills it from KUBI_RUN, else Claude Code's CLAUDE_CODE_SESSION_ID, else one id per client it creates.

Upload a file › Request Body

string · binary · maxLength: 67108864

Upload a file › Responses

Success.

path
​string · maxLength: 1024 · required
size_bytes
​integer · int32 · min: 0 · max: 67108864 · required
sha256
​string · maxLength: 64 · pattern: ^[0-9a-f]{64}$ · required

List a folder

GET
https://api.trykubi.com/v1
/screens/{screen_id}/dir
Bearer (API key)

Needs the exec permission. Answers within 5 s.

Names, types, sizes and dates in one folder, sorted by name, folders first. Moving and deleting go through exec.

List a folder › path Parameters

screen_id
​string · maxLength: 24 · pattern: ^scr_[0-9a-z]{20}$ · required

Screen id (scr_...).

List a folder › query Parameters

path
​string · minLength: 1 · maxLength: 1024 · required

Folder on the screen, absolute or relative to /home/user.

limit
​integer · int32 · min: 1 · max: 100

Page size, 1 to 100.

Default: 20
after
​string · maxLength: 200 · pattern: ^[A-Za-z0-9_-]+$

Opaque cursor from the previous page's next.

List a folder › Headers

Kubi-Run
​string · maxLength: 100 · pattern: ^[ -~]{1,100}$

Optional label that groups calls into one run in the screen's history. It is only a label and never locks the screen. The SDK fills it from KUBI_RUN, else Claude Code's CLAUDE_CODE_SESSION_ID, else one id per client it creates.

List a folder › Responses

Success.

Entries sorted by name. Folders first.
​FileEntry[] · maxItems: 1000 · required
​required