Kubi Docs
Kubi API

See the screen: JSON with a base64 image, raw image bytes, or a zoomed region.


Take a screenshot

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

Needs the read permission. Answers within 5 s.

Captures the desktop now, scaled to 1280x720 by default, and returns JSON: base64 image plus its id, size and input_seq. Add region to zoom. For raw bytes (curl, <img>) use getScreenshotImage. A copy is saved in the screen's history unless detailed history is off; the reply itself is Cache-Control: no-store.

Take a screenshot › path Parameters

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

Screen id (scr_...).

Take a screenshot › query Parameters

size
​ShotSize · maxLength: 9 · pattern: ^([0-9]{2,4}x[0-9]{2…

Image size, WIDTHxHEIGHT or full.

WIDTHxHEIGHT with the desktop's aspect ratio, or full (desktop size).

Default: 1280x720
format
​ImageFormat · enum · maxLength: 4

png (default), webp or jpeg.

png by default (lossless, sharp text, no ICC chunk). webp at quality 80 is what the hosted MCP server sends, because it is smaller. jpeg is not recommended for UI text.

Enum values:
png
webp
jpeg
Default: png
quality
​integer · int32 · min: 1 · max: 100

webp and jpeg quality, 1 to 100.

Default: 80
max_bytes
​MaxBytes · int32 · min: 1000 · max: 40000000

Cap on the encoded image: quality steps down, then the image shrinks.

Cap on the encoded image. webp and jpeg step quality 80, 70, 60, 50, then shrink; png only shrinks. The reply says the quality and size used. The hosted MCP sends 105000.

region
​string · maxLength: 19 · pattern: ^[0-9]{1,4},[0-9]{1,…

Zoom: x0,y0,x1,y1 in the units of the screenshot named by screenshot_id (else 1280x720). Returned at full resolution.

screenshot_id
​string · maxLength: 25 · pattern: ^shot_[0-9a-z]{20}$

With region: the screenshot whose size the region is measured in.

max_upscale
​string · maxLength: 4 · pattern: ^(fit|[1-8](\.[0-9])…

With region: fit (default) or a number such as 2 to cap the upscale.

Default: fit
cursor
​boolean

Draw the pointer.

Default: true
settle
​boolean

true: wait until the screen is quiet (300 ms, 2 s cap) before capturing. Default: capture now.

Default: false
windows
​boolean

true: also list the open windows (title, app, place, which is active) in windows.

Default: false

Take a screenshot › 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.

Take a screenshot › Responses

Success.

screenshot_id
​string · maxLength: 25 · pattern: ^shot_[0-9a-z]{20}$ · required

Names one capture. Pass it to runActions (and to getScreenshot with region) so coordinates use its size and stale views are refused.

​required
width
​integer · int32 · min: 1 · max: 9999 · required
height
​integer · int32 · min: 1 · max: 9999 · required
screen_width
​integer · int32 · min: 1 · max: 9999 · required
screen_height
​integer · int32 · min: 1 · max: 9999 · required
captured_at
​string · date-time · maxLength: 40 · required
input_seq
​integer · int64 · min: 0 · max: 9007199254740992 · required

Input actions run on this screen before the capture. runActions with this screenshot_id refuses to run if it has moved on.

size_bytes
​integer · int32 · min: 0 · max: 40000000 · required

Encoded image size before base64.

data
​string · maxLength: 40000000 · required

The image, base64. A copy is saved in the screen's history unless detailed history is off.

​
​
​
​
​WindowInfo[] · maxItems: 50

With windows=true: the open windows, topmost first, in this screenshot's pixels (a region's: the full screenshot's). Normal windows and dialogs only; at most 50.


Take a screenshot (image bytes)

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

Needs the read permission. Answers within 5 s.

The same capture as getScreenshot, returned as image bytes with the metadata in headers. For curl, <img> tags and scripts that save files.

Take a screenshot (image bytes) › path Parameters

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

Screen id (scr_...).

Take a screenshot (image bytes) › query Parameters

size
​ShotSize · maxLength: 9 · pattern: ^([0-9]{2,4}x[0-9]{2…

Image size, WIDTHxHEIGHT or full.

WIDTHxHEIGHT with the desktop's aspect ratio, or full (desktop size).

Default: 1280x720
format
​ImageFormat · enum · maxLength: 4

png (default), webp or jpeg.

png by default (lossless, sharp text, no ICC chunk). webp at quality 80 is what the hosted MCP server sends, because it is smaller. jpeg is not recommended for UI text.

Enum values:
png
webp
jpeg
Default: png
quality
​integer · int32 · min: 1 · max: 100

webp and jpeg quality, 1 to 100.

Default: 80
max_bytes
​MaxBytes · int32 · min: 1000 · max: 40000000

Cap on the encoded image: quality steps down, then the image shrinks.

Cap on the encoded image. webp and jpeg step quality 80, 70, 60, 50, then shrink; png only shrinks. The reply says the quality and size used. The hosted MCP sends 105000.

region
​string · maxLength: 19 · pattern: ^[0-9]{1,4},[0-9]{1,…

Zoom: x0,y0,x1,y1 in the units of the screenshot named by screenshot_id (else 1280x720). Returned at full resolution.

screenshot_id
​string · maxLength: 25 · pattern: ^shot_[0-9a-z]{20}$

With region: the screenshot whose size the region is measured in.

max_upscale
​string · maxLength: 4 · pattern: ^(fit|[1-8](\.[0-9])…

With region: fit (default) or a number such as 2 to cap the upscale.

Default: fit
cursor
​boolean

Draw the pointer.

Default: true
settle
​boolean

true: wait until the screen is quiet (300 ms, 2 s cap) before capturing. Default: capture now.

Default: false

Take a screenshot (image bytes) › 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.

Take a screenshot (image bytes) › Responses

Success.

string · binary · maxLength: 40000000