X

x402-gateway · Tools Mermaid

by x402-gateway

POSTBase

$0.005

per call · USD Coin on Base

x402-gateway tool: mermaid — Render a Mermaid diagram to an image (PNG or SVG). Returns a base64-encoded image (MCP content type image). Options: format (png|svg), theme (default|dark|forest|neutral), scale (1-4, PNG only).

Endpoint

POST https://x402.freeq.one/tools/mermaid

3

Calls / 30d

1

Unique payers / 30d

Aug 24

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://x402.freeq.one/tools/mermaid", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "code": {
      "description": "Mermaid diagram source code, e.g. 'graph TD; A-->B'. Max 50000 chars.",
      "type": "string"
    },
    "format": {
      "description": "Output format (default png). SVG returns vector text.",
      "enum": [
        "png",
        "svg"
      ],
      "type": "string"
    },
    "scale": {
      "description": "Raster scale 1-4, PNG only (default 2).",
      "type": "number"
    },
    "theme": {
      "description": "Mermaid theme (default 'default').",
      "enum": [
        "default",
        "dark",
        "forest",
        "neutral"
      ],
      "type": "string"
    }
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://x402.freeq.one/tools/mermaid" \
  -H "Content-Type: application/json" \
  -d '{"code":{"description":"Mermaid diagram source code, e.g. 'graph TD; A-->B'. Max 50000 chars.","type":"string"},"format":{"description":"Output format (default png). SVG returns vector text.","enum":["png","svg"],"type":"string"},"scale":{"description":"Raster scale 1-4, PNG only (default 2).","type":"number"},"theme":{"description":"Mermaid theme (default 'default').","enum":["default","dark","forest","neutral"],"type":"string"}}' \
  -H "X-PAYMENT: <signed x402 payment>"

Payment details

Pay to0x90b0dc893406d6ea63bb077ed59f5e8340f98d84
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

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

Get featured →

More from x402-gateway & similar services