JavaScript
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
const liveViewUrl = await box.liveView();
console.log(`Live view url: ${liveViewUrl.url}`);
}
main();import os
from gbox_sdk import GboxSDK
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])
box = gbox_sdk.create(type="android")
live_view_url = box.live_view()
print(f"Live view url: {live_view_url.url}")curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/web-terminal-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiresIn": "180m"
}
'{
"url": "https://live.gbox.cloud/web-terminal/c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
}Box
Web terminal url
This endpoint allows you to generate a pre-signed URL for accessing the web terminal of a running box. The URL is valid for a limited time and can be used to access the box’s terminal interface.
POST
/
boxes
/
{boxId}
/
web-terminal-url
JavaScript
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
const liveViewUrl = await box.liveView();
console.log(`Live view url: ${liveViewUrl.url}`);
}
main();import os
from gbox_sdk import GboxSDK
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])
box = gbox_sdk.create(type="android")
live_view_url = box.live_view()
print(f"Live view url: {live_view_url.url}")curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/web-terminal-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiresIn": "180m"
}
'{
"url": "https://live.gbox.cloud/web-terminal/c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
}Authorizations
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Path Parameters
Box ID
Example:
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Body
application/json
Web terminal configuration
The web terminal will be alive for the given duration
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: "500ms", "30s", "5m", "1h" Default: 180m
Example:
"180m"
Response
201 - application/json
Generate pre-signed web terminal url
Web terminal result
Web terminal url
Example:
"https://live.gbox.cloud/web-terminal/c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Was this page helpful?