Skip to main content

Quickstart: start your first sandbox

Sign up, create an API key, install the SDK, run a command in a sandbox and connect your coding agent.

S
Written by Sanjay Senthilkumar

From nothing to a command running in a sandbox takes a few minutes. Full docs: sandscale.dev/docs/quickstart.

Before you start

  • Node.js 22 or later for the TypeScript SDK.

  • An account on the Free plan or above.

Steps

  1. Sign up at cloud.sandscale.dev. You start on Free: 100 awake vCPU-hours a month, 3 boxes at once, up to 2 vCPU per box.

  2. In the console, open your account settings and create a personal API key. It starts with nia_, is shown once, and expires within 90 days. See Create an API key.

  3. Put the key in an environment variable:

    export SANDSCALE_API_KEY=nia_...
  4. Install the SDK:

    npm install @sandscale/sdk
  5. Save this as hello.mjs and run node hello.mjs. It starts a sandbox, runs a command, prints the output and stops the sandbox:

    import { Sandscale } from '@sandscale/sdk';const sandscale = new Sandscale(); // reads SANDSCALE_API_KEYconst box = await sandscale.sandboxes.create({ timeoutSeconds: 600 });
    try {
      const run = await sandscale.sandboxes.run(box.id, 'echo hello from a sandbox', {
        region: box.region,
        onStdout: (text) => process.stdout.write(text),
      });
      console.log('exit code', run.exitCode);
    } finally {
      await sandscale.sandboxes.stop(box.id, { region: box.region });
    }

timeoutSeconds stops the sandbox if your script never does.

Connect your coding agent

Sandscale's MCP server is at https://mcp.sandscale.dev/mcp. See Connect Claude Code, Cursor and Codex over MCP for each tool.

What next

  • SDK basics for files, errors and retries

  • Pause, resume and snapshots

  • Vault and secrets to give a run a secret without putting it in a prompt

Still stuck? Email [email protected] with the sandbox ID, the region, what you expected and what happened, and the time (with a time zone). Never send secrets, keys or tokens.

Did this answer your question?