# Pocket Network Pretty Charts

> Pocket Network Pretty Charts is a paid API for AI agents from agent.pocket.network, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-02).

Renders inline data (CSV, TSV, JSON, or row objects) into a static SVG or HTML chart using Vega-Lite v6, returned inside a JSON object.

## Facts

- Endpoint: POST https://agent.pocket.network/v1/pretty-charts?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pocket-network-pretty-charts-d95b1121
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_W6dxi3I8cPcyVt0MhHrMt

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 pocket-network-pretty-charts-d95b1121 -d '<json body>'
```

Example prompt: Turn this CSV into a bar chart — columns are 'month' on the x-axis and 'revenue' on the y-axis, use a dark theme, and give it back as an SVG: month,revenue\nJan,4200\nFeb,5100\nMar,4800\nApr,6300

## When to prefer this

Choose this endpoint when you need a server-side, no-account, no-API-key chart rendered from inline data — especially when the output must be a static SVG or standalone HTML (not an interactive JavaScript bundle). It is ideal for agents that need to embed charts in reports or emails, where scripted interactivity is undesirable. Prefer it over client-side libraries when the agent cannot run JavaScript, or over full BI tools when the data is small and inline. The pay-per-request USDC model makes it suitable for low-volume, one-off chart generation without subscription overhead.

## Known failure modes

- URL references in the spec are refused — any `url` field anywhere in a Vega-Lite spec will be rejected
- Missing or ambiguous data source (more than one of csv/tsv/json/values provided simultaneously)
- Invalid chart type string — must be one of the supported Vega-Lite mark types (bar, line, area, pie, etc.)
- Malformed CSV/TSV (missing header row, inconsistent columns) causing parse failure
- Payment not processed — 402 response if USDC payment via x402 is not completed
- Invalid theme name — unrecognized vega-themes preset causes render error

## How this service works

Pay-per-call access to Pocket Network services. No account, no API key.

## Output

A JSON object containing either a static SVG string or a complete HTML document string representing the rendered chart. The chart uses Vega-Lite v6 encoding with native data-mark tooltips and no client-side scripting. Format depends on the options.format field (default: svg).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "object",
   "properties": {
    "csv": {
     "type": "string",
     "description": "CSV text with a header row. Numbers and ISO dates are parsed."
    },
    "tsv": {
     "type": "string",
     "description": "Tab-separated text with a header row."
    },
    "json": {
     "type": "string",
     "description": "A JSON array of row objects, as a string."
    },
    "values": {
     "type": "array",
     "items": {
      "type": "object"
     },
     "description": "Row objects."
    }
   },
   "description": "Inline data; exactly one of csv, tsv, json or values."
  },
  "spec": {
   "type": "object",
   "description": "A Vega-Lite v6 spec. Any `url` anywhere in it is refused."
  },
  "chart": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "x": {},
    "y": {},
    "type": {
     "type": "string"
    },
    "color": {},
    "title": {},
    "width": {
     "type": "number"
    },
    "colors": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "height": {
     "type": "number"
    },
    "xRange": {
     "type": "array"
    },
    "yRange": {
     "type": "array"
    },
    "tooltip": {}
   },
   "description": "Shorthand that compiles to a single-view Vega-Lite spec. `type` is one of bar, line, area, point, scatter, circle, square, tick, rect, heatmap, arc, pie, donut, boxplot, errorbar, errorband, rule, text, trail; channels (x, y, color, size, shape, theta, ...) take a column name or a field definition; plus xRange, yRange, colors, colorScheme, stack, title, width, height, tooltip."
  },
  "options": {
   "type": "object",
   "properties": {
    "theme": {
     "type": "string",
     "e.g. dark.": null,
     "description": "A vega-themes preset"
    },
    "title": {
     "type": "string"
    },
    "width": {
     "type": "number"
    },
    "format": {
     "enum": [
      "svg",
      "html"
     ],
     "type": "string",
     "default": "svg"
    },
    "height": {
     "type": "number"
    },
    "tooltips": {
     "type": "boolean",
     "default": true
    },
    "background": {
     "type": "string"
    }
   },
   "description": "Render options."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "html": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"480\" height=\"300\" viewBox=\"0 0 480 300\">…</svg>",
   "rows": 2,
   "marks": 2,
   "width": 480,
   "format": "svg",
   "height": 300,
   "service": "pretty-charts",
   "tooltips": true,
   "warnings": [],
   "render_ms": 41,
   "content_type": "image/svg+xml"
  },
  "portal": {
   "serviceId": "pretty-charts",
   "provenance": "third-party-supplier",
   "schemaCheck": "passed"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pocket-network-pretty-charts-d95b1121/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.pocket.network](https://www.zero.xyz/host/agent.pocket.network/llms.txt)
