run
Execute TypeScript snippets against the Node SDK in a sandbox to provision, manage, and query AI-native Postgres databases with x402 micropayments. Returns call results, logs, and wallet details.
Instructions
Run a TypeScript snippet against the SDK in a sandbox. r is the Node SDK client (@run402/sdk/node); call docs for its reference. The code is the body of an async function: await r chains, and the value of the last expression (or a return) is the result, e.g. (await r.projects.list()).projects.map((p) => p.id). No filesystem, process, fetch, timers, or imports; console is captured. Returns { status, value, value_ref, shown, total, logs, logs_ref, calls, duration_ms, wallet, error? }; a large value is stored whole and expand_result pages it. Operations that return or consume a one-time secret (grant keys, Handoff and Invite Keys, project credentials, wallet keys) refuse with SECRET_REQUIRES_CLI naming the exact CLI command to hand the person. Any other operation is a run snippet against r.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | TypeScript or JavaScript, run as the body of an async function: top-level await works, and the value of an explicit return or of the last expression statement is the result. `r` is the Node SDK client (`@run402/sdk/node`): await any chain, e.g. `(await r.projects.list()).map(p => p.project_id)` or `await r.project("prj_…").functions.list()`. Types are stripped, not compiled: no enum, no parameter properties. No filesystem, process, fetch, timers, or imports; `console` is captured. | |
| timeout_seconds | No | Deadline for the whole run, 60 s by default and at most 300. An SDK call in flight at the deadline completes on its own; the result lists every call that completed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | No | ||
| calls | No | ||
| error | No | ||
| shown | No | ||
| total | No | ||
| value | No | ||
| status | Yes | ||
| wallet | No | ||
| logs_ref | No | ||
| value_ref | No | ||
| value_kind | No | ||
| duration_ms | No | ||
| logs_dropped | No | ||
| value_window | No | ||
| calls_dropped | No |