AI Sandboxes
Disposable sandboxes your AI agent can run code in.
One API call creates a Linux sandbox. Your agent runs the code it wrote, reads the output and files back, then deletes it. The code stays away from your machine and your servers.Python, Node or shell · from €0.052 an hour, billed by the second · European cloud region
Run Code From Your Agent
Three calls to the public REST API: create, run, delete. Use curl, any HTTP library, or the rarecloud CLI.
Create a sandbox
POST /v1/sandboxesPick a template. Python is the default, with the data stack already installed.
Run the code
POST /v1/sandboxes/ID/run_codeSend the code your model wrote and get back stdout, stderr and the exit code. Shell commands and files work the same way.
Delete it
DELETE /v1/sandboxes/IDRead out the files you want to keep, then delete the sandbox. Its billing stops when it is gone.
# 1. create a python sandbox
curl -X POST https://api.rarecloud.io/v1/sandboxes \
-H "Authorization: Bearer rc_pat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"template": "python"}'
# 2. run the model's code in it
curl -X POST https://api.rarecloud.io/v1/sandboxes/SANDBOX_ID/run_code \
-H "Authorization: Bearer rc_pat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"language": "python", "code": "import pandas as pd; print(pd.__version__)"}'
# 3. delete it
curl -X DELETE https://api.rarecloud.io/v1/sandboxes/SANDBOX_ID \
-H "Authorization: Bearer rc_pat_YOUR_TOKEN"Three templates, one rate
| Template | Per hour |
|---|---|
python Python 3.12 with numpy, pandas, matplotlib, scipy and scikit-learn. 1 vCPU, 2 GB | €0.064 |
node Node.js 22. 1 vCPU, 2 GB | €0.064 |
base Debian 12 shell and files. 1 vCPU, 1 GB | €0.052 |
€0.04 per vCPU-hour plus €0.012 per GB of memory, metered by the second from creation until you delete the sandbox. Beta prices, excluding VAT. Usage is invoiced monthly with the rest of your cloud.
Included With Every Sandbox
A real Linux userland with the tools agents reach for, kept apart from everything else you run.
Frequently Asked Questions
What is an AI sandbox for?
How are sandboxes isolated?
How is it billed?
What can I run inside?
Can I use my own image?
How long does a sandbox live?
Which tools can my agent use?
Where do sandboxes run?
AI Sandbox or Cloud VM?
Give Your Agent a Sandbox
Create an API token in the console and run your first sandbox in a few lines of code.