---
title: "Get box websocket url"
method: GET
path: "/boxes/{boxId}/websocket-url"
tags: ["Box"]
---

# Get box websocket url

`GET /boxes/{boxId}/websocket-url`

Get the websocket url for the box. This endpoint provides the WebSocket URLs for executing shell commands and running code snippets in the box environment. These URLs allow real-time communication and data exchange with the box, enabling interactive terminal sessions and code execution.

## Path parameters

- `boxId` string, required

## Response `200`

Box websocket url

- BoxWebSocketUrl — Box WebSocket Url
  - `command` string, required — WebSocket URL for executing shell commands in the box. This endpoint allows real-time command execution with streaming output, supporting interactive terminal sessions and long-running processes.
  - `runCode` string, required — WebSocket URL for running code snippets in the box environment. This endpoint enables execution of code in various programming languages with real-time output streaming, perfect for interactive coding sessions and script execution.

---

[API](https://skmtc.net/babelcloud/apis/gbox-open-api.md) · [All operations](https://skmtc.net/babelcloud/apis/gbox-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/babelcloud/gbox-open-api/versions/d655577fa915/schema)
