Quickstart

Create your first sandbox in minutes.

Start with a useful sandbox run

1. Create your workspace

Sign up, verify your email, and sign in. Then add a card on the Billing page: a card is needed before your first sandbox, and it is not charged while your trial credits last. After the trial credits are used up, usage is billed to the card at pay-as-you-go rates.

Open Templates and choose a sample:

WorkflowWhat it doesWhat you keep
CodeTests an order calculationJSON test report
BrowserOpens a sample storefront, adds an item and captures ChromiumPNG screenshot
DataReconciles sample orders and highlights exceptionsHTML report and CSV

Each sample uses synthetic data, displays actual output and elapsed time, saves artifacts where storage is available, and stops compute. You can inspect the source before running and rerun it afterward.

2. Run the same workflow from your application

Expand **Run this workflow from your application** below the sample. Choose Python or TypeScript, install the displayed SDK version, and download its complete program.

Create a key under API Keys, then set it in your local terminal:

bash
export STATESET_API_KEY='your-api-key'

The key identifies your workspace. The downloaded program uses the same source, resources and run limits as the console sample, downloads its outputs to your current directory, and stops compute.

3. A small connection check

Install the TypeScript SDK:

bash
npm install https://sandbox.stateset.app/downloads/stateset-sandbox-sdk-2.13.0.tgz tsx

Save this as agent.mts and run npx tsx agent.mts:

typescript
import { Sandbox } from '@stateset/sandbox-sdk';

const sandbox = await Sandbox.create({ timeout_seconds: 300 });
try {
  const result = await sandbox.exec(['python3', '-c', 'print(42)']);
  if (result.exit_code !== 0) throw new Error(result.stderr || 'Command failed');
  console.log(result.stdout);
} finally {
  await sandbox.close();
}

For Python, see the Python SDK guide. Both SDKs support text and binary files, templates, bounded run lifetime, and retryable cleanup.

4. Prepare a real workload

Set an explicit lifetime and run budget. Save the sandbox ID and execution receipts so you can inspect or reconnect after a network failure. Download outputs before stopping temporary sandboxes, or use retained artifacts and supported persistent workspaces.

Disk persistence does not preserve process memory. Check service capabilities before relying on pause, snapshots or recovery features. Inspect a lost execution's outcome before resubmitting a command with external effects.

Use the pricing calculator to estimate runs, retries and idle time. Review actual usage and run costs in the dashboard. Budgets are checked periodically and in-flight work may exceed a limit.

Common setup issues

  • **Confirmation email:** Check the address and spam folder, then use the verification page to resend.
  • **401 or 403:** Confirm the key, email verification and key scopes.
  • **402:** Review credits and billing or an exhausted run budget.
  • **429:** Reduce concurrency or wait for the indicated retry interval.
  • **Stop failed:** Inspect the run and retry stopping it; do not assume cleanup succeeded.

Get started · API keys · Usage · Support