# DocForge Diagram Generator

> DocForge Diagram Generator is a paid API for AI agents from docforge-selim.duckdns.org, paid per call via x402, $0.01/call, status down (last checked 2026-10-13).

Generates standalone SVG or PNG diagrams from a description or specification, billed at $0.01 USDC per call via x402 on Base.

## Facts

- Endpoint: POST https://docforge-selim.duckdns.org/diagram?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: down
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/docforge-diagram-generator-9f3a0722
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vLFEcowjDqWj6xtjtpi-Y

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-diagram-generator-9f3a0722 -d '<json body>'
```

Example prompt: Generate a flowchart diagram showing a user login process with steps for entering credentials, checking authentication, handling failure with retry, and redirecting on success — output it as an SVG.

## When to prefer this

Choose this endpoint when you need to programmatically generate a diagram (flowchart, architecture, sequence, UML, etc.) as a standalone SVG or PNG image, are comfortable with the x402 micropayment flow on Base/USDC, and want a machine-payable API rather than a SaaS dashboard. Particularly useful in agentic workflows that need to embed or deliver diagrams without human-in-the-loop tooling.

## Known failure modes

- 402 Payment Required — returned first to provide x402 payment instructions; caller must retry with a valid x402 payment header
- Invalid or insufficient payment — payment header malformed or USDC amount insufficient
- Unsupported diagram type or malformed input description — service may return 400 or error JSON
- Service unavailable on dynamic DNS host — duckdns.org domain may be offline or unreachable
- Timeout if diagram is complex or server is under load

## 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

A standalone SVG (image/svg+xml) or PNG (image/png) image file containing the rendered diagram, returned after successful x402 USDC payment on Base.

## 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": [
      "source",
      "engine"
     ],
     "properties": {
      "scale": {
       "type": "number",
       "description": "PNG only: 1-3 (default 2)"
      },
      "theme": {
       "type": "string",
       "description": "Mermaid only: default, dark or neutral (default neutral)"
      },
      "engine": {
       "type": "string",
       "description": "'mermaid' or 'graphviz'"
      },
      "output": {
       "type": "string",
       "description": "'svg' (default) or 'png'"
      },
      "source": {
       "type": "string",
       "description": "Mermaid or Graphviz DOT source (max 50KB)"
      },
      "background": {
       "type": "string",
       "description": "'transparent' or hex like '#f5f5f5' (default white)"
      }
     }
    },
    "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": "Standalone SVG (image/svg+xml) or PNG (image/png)"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/docforge-diagram-generator-9f3a0722/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)
