Skip to content
Fourohtwo

code.halowerk.com/v1/js-run

Run a short synchronous JavaScript snippet in QuickJS inside an isolated OS process, with JSON input, a JSON result and captured console output. Evaluates a JavaScript script with the input JSON available as global input. The last expression is the result; undefined becomes null. Uses installed quickjs-emscripten 0.32.0 (MIT), with a fresh WASM runtime for every call, a 32 MiB VM heap and a 500 ms

BaseAnswering
POSThttps://code.halowerk.com/v1/js-run

Uptime100% of 4 checks in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://code.halowerk.com/v1/js-run", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"code":"input.prices.reduce((sum, price) => sum + price, 0)","input":{"prices":[12,8,5]}}),
});
console.log(await res.json());

Example input

{
  "code": "input.prices.reduce((sum, price) => sum + price, 0)",
  "input": {
    "prices": [
      12,
      8,
      5
    ]
  }
}