77trust / 100

Graphviz Render

by format.halowerk.com in Email & messaging

x402 APIPassing, checked 13 h ago

Lay out a Graphviz DOT graph with dot, neato, fdp, sfdp, circo, twopi, osage or patchwork and return SVG and/or PNG with node and edge counts. Graphviz compiled to WebAssembly (@hpcc-js/wasm-graphviz 1.30) runs inside a sandboxed Chrome renderer with network blocked, so a pathological graph cannot exhaust the API process. Syntax errors return the Graphviz message; file-reading attributes (image, shapefile, imagepath) and javascript: links are rejected.

POST
https://format.halowerk.com/v1/graphviz-render
Price
$0.004
per call in USDC
Uptime
98.3%
last 30 days
Response time
145 ms
291 ms slowest 5%
Last check
Passed
13 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed · Watch with other listings

How to call it

POST https://format.halowerk.com/v1/graphviz-render

Each call costs $0.004 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://format.halowerk.com/v1/graphviz-render
content-type: application/json

{
  "dot": "digraph G { rankdir=LR; order -> invoice -> payment; order -> shipment; }",
  "engine": "dot"
}

Parameters

ParameterTypeRequiredDescription
backgroundstringNo One of: white, transparent. Default: "white".
dotstringYes
enginestringNo One of: dot, neato, fdp, sfdp, circo, twopi, osage, patchwork. Default: "dot".
formatstringNo One of: svg, png, both. Default: "svg".
scalenumberNo Default: 2.

Example response

The provider's example. We can't check it without paying. Shortened for display.

{
  "result": {
    "clusters": 0,
    "edges": 3,
    "engine": "dot",
    "format": "svg",
    "graphviz": "Graphviz via @hpcc-js/wasm-graphviz 1.30",
    "height_pt": 98,
    "nodes": 4,
    "svg": "<!-- Generated by graphviz version 16.1.0 (0)\n -->\n<!-- Title: G Pages: 1 -->\n<svg width=\"324pt\" height=\"98pt\"\n viewBox=\"0.00 0.00 324.00 98.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 94)\">\n<title>G</title>\n<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-94 320.29,-94 320.29,4 -4,4\"/>\n<!-- order -->\n<g id=\"node1\" class=\"node\">\n<title>order</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"31.41\" cy=\"-45\" rx=\"31.41\" ry=\"18\"/>\n<text xml:space=\"preserve\" text-anchor=\"middle\" x=\"31.41\" y=\"-40.8\" font-family=\"Times,serif\" font-size=\"14.00\">order</text>\n</g>\n<!-- invoice -->\n<g id=\"node2\" class=\"node\">\n<title>invoice</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"145.27\" cy=\"-72\" rx=\"39.46\" ry=\"18\"/>\n<text xml:space=\"preserve\" text-anchor=\"middle\" x=\"145.27\" y=\"-67.8\" font-family=\"Times,serif\" font-size=\"14.00\">invoice</text>\n</g>\n<!-- order&#45;&gt;invoice -->\n<g id=\"edge1\" …",
    "svg_bytes": 2397,
    "width_pt": 324
  },
  "service": "graphviz-render",
  "status": "success"
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.004.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://format.halowerk.com/v1/graphviz-render' \
  -H 'content-type: application/json' \
  --data-raw '{"dot":"digraph G { rankdir=LR; order -> invoice -> payment; order -> shipment; }","engine":"dot"}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://format.halowerk.com/v1/graphviz-render' \
  -H 'content-type: application/json' \
  --data-raw '{"dot":"digraph G { rankdir=LR; order -> invoice -> payment; order -> shipment; }","engine":"dot"}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.004 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.004" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.004 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fformat.halowerk.com%2Fv1%2Fgraphviz-render&method=POST
const res = await pay("https://format.halowerk.com/v1/graphviz-render", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "dot": "digraph G { rankdir=LR; order -> invoice -> payment; order -> shipment; }",
    "engine": "dot"
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.004 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.004"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://format.halowerk.com/v1/graphviz-render",
        json={
            "dot": "digraph G { rankdir=LR; order -> invoice -> payment; order -> shipment; }",
            "engine": "dot",
        },
    )
    print(res.status_code, res.text)

Security scan

No findings

We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
13 h agoPassed402128 ms$0.004
3 days agoTimed out---
4 days agoPassed402139 ms$0.004
4 days agoPassed402127 ms$0.004
5 days agoPassed402470 ms$0.004
Show 10 older checks
5 days agoPassed402124 ms$0.004
5 days agoPassed402291 ms$0.004
6 days agoPassed402161 ms$0.004
6 days agoPassed402115 ms$0.004
6 days agoPassed402127 ms$0.004
7 days agoPassed402122 ms$0.004
7 days agoPassed40240 ms$0.004
7 days agoPassed402130 ms$0.004
8 days agoPassed402173 ms$0.004
8 days agoPassed402145 ms$0.004