Node.js
/v1/nodejs/execute is aiod's JavaScript execution route: scripts, JSON processing, web tooling, JS-based automation.
It always runs on the daemon's native REPL, a process spawned directly, needing only node on PATH. No external service is required.
The same execution is also reachable by language, not just by route. Pass language: "javascript" (or "node") to POST /v2/code/execute. There is no separate /v2/nodejs.
What it needs
node on PATH. GET /v1/capabilities confirms it: code_interpreter.kinds contains nodejs, javascript_backend is native, and default_node names the binary that will be spawned — NODE_VERSION or NODE_CODE_EXEC_VERSION choose it where several are installed.
Run a snippet
A call without session_id keeps nothing after it returns:
Request body:
The request fields are the same as the code plane's: code (required), session_id, stateful, timeout (1–900 s, default 30), cwd, user. The response has the same shape; this route represents an empty stream as "" rather than null.
console.log becomes a stream output; the cell's last expression becomes an execute_result with a text/plain value, so globalThis.n = 41 answers with 41 even though nothing was printed.
Runtime info
runtime_packages and global_packages are always empty here. What is installed comes from GET /v2/sandbox/packages?lang=nodejs.
Sessions
Pass session_id to keep globals across calls. Session state lives in memory: it persists within the session but is gone after aiod restarts.
Sessions share the native code plane's limits: up to 20 at once, idle-closed after 1800 s (AIO_CODE_MAX_SESSIONS / AIO_CODE_SESSION_TIMEOUT_SECS). One more than that is a 429.
Both SDKs cover execution and session management:
Which SDK calls reach this route unchanged is listed in 1.x SDK compatibility.
Errors and timeouts
A throw is an HTTP 200 with success: false and status: "error". The error output carries ename, evalue, and a traceback whose frames name evalmachine.<anonymous>, since the code runs in a VM context rather than as a file.
A run past its timeout answers status: "timeout" and execution timed out after 2000ms; session state was reset in both stderr and the error output. The daemon kills the interpreter five seconds past the deadline; the session stays open with an empty namespace.
Choosing an API
/v1/nodejs/executefor JavaScript-specific execution./v2/code/execute(or/v1/code/execute) when your caller picks the language dynamically./v1/bash/execor/v2/commandsfor shell commands such asnpm install.