# WDH.sh Chart Rendering API

> WDH.sh Chart Rendering API is a paid API for AI agents from charts.wdh.sh, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-10).

Renders Chart.js chart configurations (bar, line, pie, financial OHLC, etc.) into PNG or SVG image files via a proxy backed by chartsplat.

## Facts

- Endpoint: POST https://charts.wdh.sh/chart?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wdh-sh-chart-rendering-api-af3d52cb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mOqmSiCDqoE5Qlh-4wbeF

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 wdh-sh-chart-rendering-api-af3d52cb -d '<json body>'
```

Example prompt: Generate a bar chart image with labels ['Jan','Feb','Mar'] and a dataset called 'Sales' with values [120, 95, 140] — I need it as a PNG.

## When to prefer this

Choose this endpoint when you need server-side chart rendering to a portable image (PNG/SVG) without running a browser or Chart.js locally. Ideal for agents generating reports, emails, or dashboards that embed chart images, especially when financial OHLC/candlestick charts are needed alongside standard Chart.js types.

## Known failure modes

- Invalid chart type enum returns error — only bar, line, pie, doughnut, radar, polarArea, candlestick, ohlc are accepted
- Missing required datasets field in data object causes validation error
- Malformed OHLC dataset (missing x, o, h, l, c fields) for candlestick/ohlc chart type
- Payment failure or insufficient USDC balance blocks the request (x402 payment required)
- Upstream chartsplat service unavailable results in proxy error

## How this service works

A Chart.js-compatible charting endpoint: POST a standard Chart.js config — the same `{ type, data, options }` you'd hand to `new Chart()` — and get back a rendered PNG. Backed by chartsplat.com, it renders every chart type chartsplat supports: bar, line, pie, doughnut, radar, polar area, and OHLC/candlestick (financial) charts, with the full set of Chart.js options (labels, multiple datasets, colors, titles, legends, scales). Made for embedding charts as images in agent reports, dashboards, Discord/Slack messages, and trading screenshots — anywhere you need a static image, not an interactive widget.

## Output

Raw image bytes (PNG or SVG) of the rendered chart, returned with content-type image/png or image/svg+xml. The image can be saved to disk, embedded in a document, or displayed directly.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "object",
   "required": [
    "datasets"
   ],
   "properties": {
    "labels": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "datasets": {
     "type": "array",
     "items": {
      "type": "object"
     },
     "description": "One or more Chart.js datasets."
    }
   },
   "description": "Chart.js `data` object: `labels` plus one or more `datasets` (each `{ label, data, ...styling }`)."
  },
  "type": {
   "enum": [
    "bar",
    "line",
    "pie",
    "doughnut",
    "radar",
    "polarArea",
    "candlestick",
    "ohlc"
   ],
   "type": "string",
   "description": "Chart.js chart type. `candlestick`/`ohlc` are financial charts whose datasets take OHLC points (`{ x, o, h, l, c }`)."
  },
  "options": {
   "type": "object",
   "description": "Optional Chart.js `options` (title, legend, scales, colors, …)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "note": "Response body is the raw chart image bytes (PNG or SVG per upstream).",
  "contentType": "image/png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wdh-sh-chart-rendering-api-af3d52cb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from charts.wdh.sh](https://www.zero.xyz/host/charts.wdh.sh/llms.txt)
