# DocForge Chart Generator

> DocForge Chart Generator is a paid API for AI agents from docforge-selim.duckdns.org, paid per call via x402, $0.02/call, status down (last checked 2026-09-15).

Generates SVG or PNG charts from data via a pay-per-call x402 (USDC on Base) API endpoint

## Facts

- Endpoint: POST https://docforge-selim.duckdns.org/chart
- Price: $0.02/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/docforge-chart-generator-db7f0fce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xN2YnGyOKQDC0pxH-b9A9

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 docforge-chart-generator-db7f0fce -d '<json body>'
```

Example prompt: Generate a bar chart showing monthly sales — January $12,000, February $15,500, March $9,800 — and give it to me as a PNG image.

## When to prefer this

Use this endpoint when you need to programmatically generate chart images (SVG or PNG) on a pay-per-use basis with USDC micropayments via x402, without requiring an API key subscription. Ideal for agents that need occasional chart generation billed per call rather than a flat subscription.

## Known failure modes

- 402 Payment Required if x402 payment header is missing or invalid — must retry with a valid USDC on Base payment header
- Invalid or malformed chart data causing a 400 Bad Request
- Unsupported chart type resulting in an error response
- Network or service unavailability from the dynamic DNS host (duckdns.org) causing timeouts

## How this service works

Machine-payable document & media generation via x402 (USDC on Base). Endpoints respond 402 with payment instructions; retry with an x402 payment header.

## Output

Returns an SVG (image/svg+xml) or PNG (image/png) chart image rendered from the provided data. The format depends on the output parameter: omit for SVG or set output=png for PNG.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [],
     "properties": {
      "type": {
       "type": "string",
       "description": "line (default), bar, pie, donut, scatter, area"
      },
      "theme": {
       "type": "string",
       "description": "light (default) or dark"
      },
      "title": {
       "type": "string"
      },
      "width": {
       "type": "number",
       "description": "200-2000, default 800"
      },
      "height": {
       "type": "number",
       "description": "200-2000, default 500"
      },
      "labels": {
       "type": "array",
       "description": "X-axis categories or pie/donut slice names"
      },
      "output": {
       "type": "string",
       "description": "svg (default) or png"
      },
      "series": {
       "type": "array",
       "description": "[{ name?, data: number[] }]; scatter also accepts [x,y] pairs. Required unless echartsOption is used."
      },
      "xLabel": {
       "type": "string"
      },
      "yLabel": {
       "type": "string"
      },
      "stacked": {
       "type": "boolean"
      },
      "transparent": {
       "type": "boolean"
      },
      "echartsOption": {
       "type": "object",
       "description": "Raw ECharts passthrough (mutually exclusive with type/series)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": "SVG chart (image/svg+xml) or PNG (image/png) when output=png"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/docforge-chart-generator-db7f0fce/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from docforge-selim.duckdns.org](https://www.zero.xyz/host/docforge-selim.duckdns.org/llms.txt)
