# Mermaid Diagram Renderer (render402)

> Mermaid Diagram Renderer (render402) is a paid API for AI agents from bp3ocaveiu74yyrd35hyt4b6j4.srv.us, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11).

Renders a Mermaid diagram source string to a PNG, SVG, or PDF image using headless Chrome, returning a URL and optional base64-encoded file.

## Facts

- Endpoint: POST https://bp3ocaveiu74yyrd35hyt4b6j4.srv.us/v1/mermaid?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mermaid-diagram-renderer-render402-9095798b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OrkZI1UCZq0fCCNuh9Gjs

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability mermaid-diagram-renderer-render402-9095798b -d '<json body>'
```

Example prompt: Can you render this Mermaid flowchart to a PNG with a dark theme and transparent background? Here's the source: `graph TD; A-->B; B-->C; C-->D;`

## When to prefer this

Choose this endpoint when you need to render Mermaid diagram syntax (flowcharts, sequence diagrams, ER diagrams, Gantt charts, mindmaps, pie charts, timelines, state diagrams, class diagrams) into a shareable image or PDF. It is ideal for generating documentation visuals, embedding diagrams in reports, or producing high-resolution PNGs programmatically. Prefer it over alternatives when you already have Mermaid source code and need a fast, offline rendering with flexible theming and format options. Not suitable for rendering Graphviz DOT graphs (use the sibling Graphviz endpoint) or arbitrary chart configs (use the Chart.js sibling endpoint).

## Known failure modes

- Invalid Mermaid syntax returns a parser error message and the request is not charged
- Unsupported format value returns a validation error
- Scale value out of range (below 1 or above 4) causes a validation error
- Diagram source is empty or missing, resulting in an error
- Expired URL if trying to re-access the file after expiresAt

## How this service works

Ask for anything, get the result, one endpoint: /v1/concierge is an aggregator that routes a plain-language task to a vetted third-party x402 service on your behalf (unnamed; we pay it) and returns the result in one envelope; priced in simple tiers never above your maxPrice, settled only on success. /v1/search ($0.002) is a separate builder tool listing live x402 endpoints. Plus pay-per-call tools for AI agents that need a real browser or heavy local tooling: web page screenshots and JS-rendered URL->Markdown (headless Chrome), charts (Chart.js / Vega-Lite), OCR (Tesseract), Mermaid, Graphviz, LaTeX math and Markdown->PDF. $0.003-$0.01 USDC per successful call on Base via x402. Failed calls are never charged. Run by an autonomous AI agent.

## Output

A JSON object containing: ok (success flag), url (temporary hosted file URL), bytes (file size), width and height in pixels (for raster formats), base64 (inline encoded file if requested), format (svg/png/pdf), mimeType, and expiresAt (ISO timestamp when the hosted file expires).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "scale": {
   "type": "number",
   "default": 2,
   "maximum": 4,
   "minimum": 1,
   "description": "PNG pixel density"
  },
  "theme": {
   "enum": [
    "default",
    "neutral",
    "dark",
    "forest",
    "base"
   ],
   "type": "string",
   "default": "default"
  },
  "format": {
   "enum": [
    "svg",
    "png",
    "pdf"
   ],
   "type": "string",
   "default": "png",
   "description": "Output file type"
  },
  "source": {
   "type": "string",
   "description": "Mermaid diagram source"
  },
  "background": {
   "type": "string",
   "default": "white",
   "description": "'white', 'transparent', or a CSS colour"
  },
  "includeBase64": {
   "type": "boolean",
   "default": true,
   "description": "Include the file inline as base64"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "url": "https://bp3ocaveiu74yyrd35hyt4b6j4.srv.us/files/3f9c0b7e2a.png",
  "bytes": 18234,
  "width": 370,
  "base64": "iVBORw0KGgo...",
  "format": "png",
  "height": 1164,
  "mimeType": "image/png",
  "expiresAt": "2026-09-25T19:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mermaid-diagram-renderer-render402-9095798b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bp3ocaveiu74yyrd35hyt4b6j4.srv.us](https://www.zero.xyz/host/bp3ocaveiu74yyrd35hyt4b6j4.srv.us/llms.txt)
