Skip to content

SDK client ​

Top-level Sandbox and Template exports read connection settings from the environment. Create an AgentBox client when one process needs explicit settings or more than one isolated configuration.

mjs
import { AgentBox } from "@abox-dev/sdk";

const client = new AgentBox({ apiKey: process.env.AGENTBOX_API_KEY });
const sandbox = await client.Sandbox.create();

try {
  const result = await sandbox.commands.run("printf 'explicit client works'");
  console.log(result.stdout);
} finally {
  await sandbox.kill();
}

Client settings are defaults. Options passed to a particular SDK call take precedence. JavaScript exposes Sandbox and Template, Python also exposes their async variants, and Go exposes client.Sandboxes and client.Templates.

Use the SDK reference for the exact options supported by each language.