# agentsvc.io Mermaid Diagram Renderer

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

Renders Mermaid diagram source code into SVG or PNG images with configurable themes, dimensions, and backgrounds

## Facts

- Endpoint: POST https://agentsvc.io/api/v1/proxy/diagram-render?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentsvc-io-mermaid-diagram-renderer-6afba0d6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HQFiYpJQpvPzTKVXXaiq9

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 agentsvc-io-mermaid-diagram-renderer-6afba0d6 -d '<json body>'
```

Example prompt: Can you render this Mermaid diagram code as a PNG using the dark theme at 1600px wide? Here's the code: `graph TD; A-->B; B-->C;`

## When to prefer this

Choose this endpoint when you need server-side Mermaid rendering without setting up a local rendering environment — ideal for CI pipelines, documentation bots, or AI agents that generate architecture diagrams on the fly. It supports multiple themes and formats (SVG/PNG) in a single call-and-pay model with no API key required.

## Known failure modes

- Invalid or unparseable Mermaid syntax returns an error with no rendered output
- Width outside the 200–4000 range is rejected
- Unsupported theme enum value causes a validation error
- Very large or deeply nested diagrams may time out or produce oversized output
- Payment failure via x402 results in a 402 response with no diagram rendered

## How this service works

86 APIs for AI agents: web scraping and crawling to Markdown, AI summaries, data extraction and cited answers, screenshots and PDF, PDF, OCR and document conversion, news, paper and developer search and more, paid per call with USDC on Base, Solana, Polygon or Arbitrum via x402. No account, no API key, free sample on every service.

## Output

Returns a JSON object containing the rendered SVG markup string (and/or PNG data), the theme applied, the output format, the size in bytes, and the detected diagram type (e.g. flowchart, sequence).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string",
   "description": "Mermaid diagram source"
  },
  "theme": {
   "enum": [
    "default",
    "dark",
    "neutral",
    "forest",
    "base"
   ],
   "type": "string",
   "default": "default"
  },
  "width": {
   "type": "integer",
   "default": 1200,
   "maximum": 4000,
   "minimum": 200
  },
  "format": {
   "enum": [
    "svg",
    "png",
    "both"
   ],
   "type": "string",
   "default": "svg"
  },
  "background": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentsvc-io-mermaid-diagram-renderer-6afba0d6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentsvc.io](https://www.zero.xyz/host/agentsvc.io/llms.txt)
