H

Halowerk · State Machine Step

by Halowerk

POSTBase

$0.002

per call · USD Coin on Base

Takes a machine definition, the current state, one event and an optional context, and computes a single step. Transitions may carry a guard, which is a declared comparison — field, operator, value — and never an expression: the field is a dotted path into context or payload, so a machine handed in by a stranger cannot execute anything on this server.

Endpoint

POST https://agent.halowerk.com/v1/state-machine-step

1

Calls / 30d

1

Unique payers / 30d

Aug 19

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://agent.halowerk.com/v1/state-machine-step", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "context": {
      "attempts": 1
    },
    "current_state": "awaiting_quote",
    "elapsed_in_state_s": 120,
    "event": {
      "name": "quote_received",
      "payload": {
        "amount_eur": 420
      }
    },
    "machine": {
      "initial": "awaiting_quote",
      "states": [
        {
          "name": "awaiting_quote",
          "on": [
            {
              "actions": [
                "book_slot"
              ],
              "event": "quote_received",
              "guard": {
                "field": "payload.amount_eur",
                "op": "lte",
                "value": 500
              },
              "target": "quote_accepted"
            },
            {
              "actions": [
                "request_approval"
              ],
              "event": "quote_received",
              "target": "needs_approval"
            },
            {
              "event": "cancel",
              "target": "cancelled"
            }
          ],
          "timeout_actions": [
            "notify_requester"
          ],
          "timeout_s": 3600,
          "timeout_target": "expired"
        },
        {
          "name": "quote_accepted",
          "on": [
            {
              "event": "cancel",
              "target": "cancelled"
            }
          ]
        },
        {
          "name": "needs_approval",
          "on": [
            {
              "event": "approved",
              "target": "quote_accepted"
            }
          ]
        },
        {
          "final": true,
          "name": "cancelled"
        },
        {
          "final": true,
          "name": "expired"
        }
      ]
    },
    "timeout_precedence": "timeout"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://agent.halowerk.com/v1/state-machine-step" \
  -H "Content-Type: application/json" \
  -d '{"context":{"attempts":1},"current_state":"awaiting_quote","elapsed_in_state_s":120,"event":{"name":"quote_received","payload":{"amount_eur":420}},"machine":{"initial":"awaiting_quote","states":[{"name":"awaiting_quote","on":[{"actions":["book_slot"],"event":"quote_received","guard":{"field":"payload.amount_eur","op":"lte","value":500},"target":"quote_accepted"},{"actions":["request_approval"],"event":"quote_received","target":"needs_approval"},{"event":"cancel","target":"cancelled"}],"timeout_actions":["notify_requester"],"timeout_s":3600,"timeout_target":"expired"},{"name":"quote_accepted","on":[{"event":"cancel","target":"cancelled"}]},{"name":"needs_approval","on":[{"event":"approved","target":"quote_accepted"}]},{"final":true,"name":"cancelled"},{"final":true,"name":"expired"}]},"timeout_precedence":"timeout"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Payment details

Pay to0x2880edfff13100677bf97a3cbdf3bc34771c4e5e
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Other and the homepage with a featured placement.

Get featured →

More from Halowerk & similar services

H

Halowerk · LLM Catalog

modell.halowerk.com

A comparison table of language models: input, output and cache prices per million tokens, context window, maximum output length, batch discount and a short note on what each is suited to. Filter by vendor, by a maximum price, by the context window you need, or by capability tag. Every row carries the date its prices were last checked, so a stale figure is visible rather than silently wrong.

POSTBaseAI & Inference
$0.005 / call8 calls / 30d
H

Halowerk · EV Charging

karte.halowerk.com

Queries OpenStreetMap for charging stations within a radius of a point and returns each with its position, distance, operator, network, connector types with their individual power ratings and socket counts, access restrictions, fee status, opening hours and whether authentication is required. Results are sorted nearest first and can be filtered to a minimum power or a required connector type, which is the question a vehicle actually has.

POSTBaseOther
$0.005 / call5 calls / 30d
H

Halowerk · Inverter Load Check

solar.halowerk.com

Continuous load is the sum of the running watts of all appliances marked as simultaneous. The surge check adds the largest single starting surge on top of the continuous load, which is the case that trips an inverter; simultaneous starts of two motors are reported separately as a second figure. Starting factors and power factors are design rules of thumb per appliance class and are stated in the response, they are not device data.

POSTBaseOther
$0.002 / call4 calls / 30d