Skip to main content

1. Get Your API Key

1

Sign Up

Create an account at runtools.ai/signup
2

Create API Key

Go to Dashboard → API Keys → Create New Key
3

Copy Key

Copy your API key. It starts with rt_live_ for production or rt_test_ for testing.
Keep your API key secure. Never commit it to version control or expose it in client-side code.

2. Install the SDK

npm install @runtools/sdk

3. Create Your First Sandbox

import { RunTools } from '@runtools/sdk';

// Initialize the client
const rt = new RunTools({ 
  apiKey: process.env.RUNTOOLS_API_KEY 
});

// Create a sandbox with Node.js 20
const sandbox = await rt.sandboxes.create({ 
  template: 'nodejs-20' 
});

console.log(`Sandbox created: ${sandbox.id}`);
console.log(`Status: ${sandbox.status}`);

4. Execute Commands

// Run a command
const result = await sandbox.exec('node --version');
console.log(result.stdout); // v20.x.x

// Run multiple commands
await sandbox.exec('npm init -y');
await sandbox.exec('npm install express');

// Create a file
await sandbox.files.write('/app.js', `
const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello from RunTools!');
});

app.listen(3000, () => {
  console.log('Server running on port 3000');
});
`);

// Start the server
await sandbox.exec('node app.js &');

5. Get the Public URL

// Get a public URL for your app
const url = await sandbox.getUrl({ port: 3000 });
console.log(`Your app is live at: ${url}`);
// → https://sandbox-abc123.sandboxes.runtools.ai

6. Pause and Resume

// Pause the sandbox (saves state, stops billing)
await sandbox.pause();
console.log('Sandbox paused');

// Later: resume in under 1 second
await sandbox.resume();
console.log('Sandbox resumed');

// Your server is still running!

7. Clean Up

// Destroy the sandbox when done
await sandbox.destroy();

Next Steps

Using the CLI

Prefer the command line? Scaffold a new project:
npx create-runtools-app my-app
cd my-app
This creates:
my-app/
├── runtools.config.ts       # Project configuration
├── agents/
│   └── assistant.ts         # Your first agent
├── package.json
└── tsconfig.json
Agents can be single files (agents/assistant.ts) or folders with an entry point (agents/my-bot/index.ts) for complex agents with multiple files.
Then start developing:
# Start local development
runtools dev

# Push to dashboard for preview
runtools push

# Deploy to production
runtools deploy
Or install the CLI globally:
npm install -g @runtools/cli
runtools login
runtools init

CLI Reference

Learn more about the CLI