Network
Reach services inside a screen through its ports, and send its traffic through your own proxy.
Read a port
Needs the network permission. Answers within 2 s.
One open port, with its URL and token.
path Parameters
screen_id^scr_[0-9a-z]{20}$ · requiredScreen id (scr_...).
portA TCP port inside the screen, 1 to 65535.
Headers
Kubi-Run^[ -~]{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.
Read a port › Responses
Success.
portThe TCP port inside the screen.
accesstoken: every request must carry the token in Kubi-Port-Token. link: the URL alone gets in, for apps that can't add a header; anyone holding it reaches the service.
urlThe port's own HTTPS origin. Keep it secret with link access.
screen_id^scr_[0-9a-z]{20}$ · requiredcreated_atOpen a port
Needs the network permission. Answers within 5 s.
Gives the service listening on this port inside the screen its own HTTPS URL, for HTTP and WebSocket requests: a dev server, an app's API, a coding agent's server. At most 3 ports per screen, included in the price. With token access (the default) every request carries the returned token in Kubi-Port-Token; your own Authorization header passes through to the service. With link access the URL alone gets in. The port stays open across stop and start, and closes with the screen. Opening a port that is already open with the same access returns it unchanged (200); with the other access it is refused, so close it first. Raw TCP (SSH, databases) is not carried.
path Parameters
screen_id^scr_[0-9a-z]{20}$ · requiredScreen id (scr_...).
portA TCP port inside the screen, 1 to 65535.
Headers
Kubi-Run^[ -~]{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.
Open a port › Request Body optional
accessOpen a port › Responses
Already open with this access.
portThe TCP port inside the screen.
accesstoken: every request must carry the token in Kubi-Port-Token. link: the URL alone gets in, for apps that can't add a header; anyone holding it reaches the service.
urlThe port's own HTTPS origin. Keep it secret with link access.
screen_id^scr_[0-9a-z]{20}$ · requiredcreated_atClose a port
Needs the network permission. Answers within 2 s.
The URL stops answering, and connections open through it end within 3 seconds. Open it again for a new URL and token.
path Parameters
screen_id^scr_[0-9a-z]{20}$ · requiredScreen id (scr_...).
portA TCP port inside the screen, 1 to 65535.
Headers
Kubi-Run^[ -~]{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.
Close a port › Responses
Closed.
List open ports
Needs the network permission. Answers within 2 s.
The screen's open ports with their URLs and tokens.
path Parameters
screen_id^scr_[0-9a-z]{20}$ · requiredScreen id (scr_...).
Headers
Kubi-Run^[ -~]{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.