Run job (async)
run_jobRun a shell command as a background job in a fresh sandbox and return a job_id immediately (state queued or running). The job keeps running without this connection, up to timeout_s; the sandbox is removed when it ends, but the log, the result files and an execution receipt are kept. Use it for work longer than about a minute or when you do not want to wait; a quick command in a sandbox you keep working in is better run interactively. Only files matching artifacts (or ./output/ with save_artifacts) are kept – everything else is deleted with the sandbox. Billed per second of run time. With max_cost the job is refused up front if its worst case (timeout_s at the class price) could exceed the limit – lower timeout_s or raise the limit; it is also refused when the account's monthly or daily budget would be exceeded. If no server of the requested compute class is free, the job waits queued and is never moved to a weaker class. Repeating the call with the same idempotency_key returns the same job instead of starting a second one.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "run_job"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | Optional IP version of the job's sandbox: ipv4 (default), dual or ipv6. | |
| cwd | No | Working directory (default /home/user). | |
| env | No | Environment variables (e.g. API keys). Values are masked in the log and not stored after the job ends. | |
| wasm | No | Only with runtime wasi: the WebAssembly module to run and its arguments, standard input and memory limit. The module has no network and no shell, sees only /input, /output and /tmp, and command is not needed. | |
| allow | No | Allow only these destinations (web traffic on ports 80/443 by hostname, or IP ranges). | |
| inputs | No | Result files of your earlier finished jobs to give this job (copied to ./input/<as>, checked by SHA-256). In run_batch, from_index refers to another job of the same batch and makes this job wait for it. | |
| command | No | Shell command, e.g. 'pip install -r requirements.txt && python analyze.py'. Required, except with runtime wasi. | |
| runtime | No | firecracker (default, full Linux microVM) or wasi (WebAssembly module: no network, fast start; needs wasm). | |
| internet | No | Internet access (default true). | |
| max_cost | No | Optional hard price limit in your account's billing currency, e.g. "0.10". The job is refused if the worst case could exceed it. | |
| template | No | Template (default 'base'). | |
| artifacts | No | Result files to keep, as glob patterns relative to the working directory, e.g. ["output/", "*.csv"]. | |
| placement | No | Optional node choice: auto (default), fast (fastest node) or spread. | |
| timeout_s | No | Time limit for the command in seconds (default 3600, max 86400). | |
| webhook_url | No | Optional public https:// URL that gets a signed POST (job.finished) with the result when the job ends. | |
| max_attempts | No | Run again automatically after a platform failure, up to this many attempts (default 1). | |
| optimize_for | No | Optional: pick the server inside the compute class by price, balanced or performance. Never changes the class or its price. | |
| compute_class | No | Optional performance class: economy, balanced, performance, memory (dedicated if your organization has reserved servers). Without it your account's default class is used. The class is never downgraded; the job waits if no server of the class is free. | |
| save_artifacts | No | Keep everything the command writes to ./output/ (used when artifacts is empty). | |
| idempotency_key | No | Optional: the same key returns the same job instead of starting a new one (safe to retry this call). | |
| dependency_cache | No | Use the node's verified package cache for pip/npm/Go (default true when enabled by the operator). | |
| required_artifacts | No | Result files that must be saved for the job to count as completed, e.g. ["output/report.csv"]. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Job ID (job_…). | |
| status | Yes | Job state, e.g. queued or running. | |
| max_cost | No | Cost as an object with amount and currency, or null. |