Render Mermaid diagram code to SVG and/or PNG
agentsvc.io/api/v1/proxy/diagram-render
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-renderUptimeNot checked yet
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
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
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"
}