createSandbox
Set up a Linux sandbox to execute code, run commands, and manage files. Create a sandbox with custom settings, obtain a sandbox_id for operations, and control costs by pausing automatically after use.
Instructions
Create a Linux sandbox that can execute code, run commands, upload and download files, and has complete Linux functionality. After successful creation, a sandbox_id will be returned, and all subsequent operations will need to include this sandbox_id to specify the corresponding sandbox. Except for directRunCode, all other operations require the creation of a sandbox first. After successful creation, the sandbox will automatically pause. When calling other sandbox operation interfaces later, it will automatically reconnect and pause again after execution to avoid generating extra costs.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"max_alive_time": "<max_alive_time>"
},
"name": "createSandbox"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| envs | No | Environment variables to set (optional) | |
| max_alive_time | Yes | Maximum alive time of the sandbox (seconds), recommand 300. | |
| metadata | No | Sandbox metadata (optional) | |
| sandbox_name | No | Custom sandbox name (optional) |