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}/live-view-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiresIn": "180m"
}
'{
"url": "https://gbox.ai/share/live-view/tmp_xxxxxxx",
"rawUrl": "https://gbox.ai/share/live-view/tmp_xxxxxxx/raw"
}Live view url
This endpoint allows you to generate a pre-signed URL for accessing the live view of a running box. The URL is valid for a limited time and can be used to view the box’s live stream.
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}/live-view-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiresIn": "180m"
}
'{
"url": "https://gbox.ai/share/live-view/tmp_xxxxxxx",
"rawUrl": "https://gbox.ai/share/live-view/tmp_xxxxxxx/raw"
}Authorizations
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Path Parameters
Box ID
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Body
Live view configuration
The live view 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
"180m"
Response
Generate pre-signed live view url
Live view result
Live view url with Gbox interface and basic information, typically used for real-time observation of box usage status
"https://gbox.ai/share/live-view/tmp_xxxxxxx"
Raw live view url without additional layout content, typically used for embedding into your own application
"https://gbox.ai/share/live-view/tmp_xxxxxxx/raw"
Was this page helpful?