Get public URL of a port
get_public_urlGet an HTTPS URL for a TCP port in the sandbox, e.g. a web app or API you started there. The app must listen on 0.0.0.0 (not only 127.0.0.1) and keep running – start it in the background, e.g. nohup python3 -m http.server 8000 >/tmp/srv.log 2>&1 &. The URL is protected by a token: open url_with_token in a browser (the token moves to a cookie), or send the X-WBX-Token header. Anyone with the token can use the app until the sandbox ends. WebSockets work.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"port": "<port>"
},
"name": "get_public_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | TCP port in the sandbox (1–65535) | |
| sandbox_id | No | Sandbox ID (sb_…). If omitted, the current sandbox of this session is used. A sandbox_id you pass becomes the current sandbox for later calls without sandbox_id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | HTTPS URL; needs the X-WBX-Token header. | |
| port | Yes | TCP port in the sandbox. | |
| token | Yes | Access token for the URL. | |
| sandbox_id | Yes | Sandbox ID. | |
| url_with_token | Yes | HTTPS URL to open in a browser (the token moves to a cookie). |