This guide will show you how to create your first box
Get an API Key
env
GBOX_API_KEY=gbox-******
Install GBOX SDK
npm install gbox-sdk dotenv
Write code for create a box
import GboxSDK from "gbox-sdk"; import * as dotenv from "dotenv"; dotenv.config(); const gboxSDK = new GboxSDK(); async function main() { const myBox = await gboxSDK.create({ type: "linux" }); console.log(`Linux box created: ${myBox.data.id}`); const result = await myBox.runCode({ code: `print("Hello from Python!")`, language: "python" }) console.log("Python execution result:"); console.log(result) } main();
Run the code
npx tsx ./index.ts
Was this page helpful?