81trust / 100

Proxy Diagram Render

by Mermaid Diagram Renderer in Developer tools

x402 APIPassing, checked 1 h ago

Render Mermaid diagram code to SVG and/or PNG: flowchart, sequence, class, state, ER, gantt, pie, mindmap, timeline and more. Invalid syntax returns HTTP 400 with the Mermaid parse error (not charged), so an agent can fix and retry. Params: code (Mermaid source, required), format (svg default, png or both), theme (default, dark, neutral, forest, base), width (200 to 4000, default 1200), background.

POST https://agentsvc.io/api/v1/proxy/diagram-render

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
29 ms typical, 29 ms slowest 5%
Last check
1 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agentsvc.io/api/v1/proxy/diagram-render" \
  -H "content-type: application/json" \
  -d '{"code":"flowchart LR\n  A[Agent] -->|HTTP 402| B(agentsvc.io)\n  B --> C{Paid?}\n  C -->|yes| D[JSON result]","format":"svg"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagentsvc.io%2Fapi%2Fv1%2Fproxy%2Fdiagram-render
const res = await pay("https://agentsvc.io/api/v1/proxy/diagram-render", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"code":"flowchart LR\n  A[Agent] -->|HTTP 402| B(agentsvc.io)\n  B --> C{Paid?}\n  C -->|yes| D[JSON result]","format":"svg"}),
});
console.log(await res.json());

Example input

{
  "code": "flowchart LR\n  A[Agent] -->|HTTP 402| B(agentsvc.io)\n  B --> C{Paid?}\n  C -->|yes| D[JSON result]",
  "format": "svg"
}

Example output

{
  "data": {
    "diagram_type": "flowchart",
    "format": "svg",
    "svg": "<svg id=\"dccuoprioa\" width=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" class=\"flowchart\" style=\"max-width: 948.234375px;\" …",
    "svg_bytes": 13690,
    "theme": "default"
  },
  "success": true
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
1 h agoPassed40233 ms$0.01
7 h agoPassed40229 ms$0.01