# Executive SVG Chart & KPI Card Compiler Edge API (v1.0.0)

> Compile board-ready SVG charts (waterfall, funnel, gantt, bar, line) and KPI sparkline cards with zero overlapping labels in <10ms.

Deterministic publication-grade standalone SVG chart compiler (bar, stacked_bar, horizontal_bar, line, area, waterfall, funnel, gantt) and multi-metric KPI sparkline snapshot cards with mathematically verified zero-overlap text layout.

## Why Agents Use This API Instead of DIY
Eliminates clipped axes, overlapping x-axis text, broken floating-point tick steps, heavyweight headless-browser Chart.js/Playwright containers, and thousands of wasted LLM tokens generating raw SVG coordinates.

## Connection & Payment (x402 Default + Optional Bearer API Key)
- **MCP Server (Streamable HTTP):** `https://chart-viz.apikeg.com/mcp` (Registry ID: `com.apikeg/chart-viz` — `initialize`, `tools/list`, `resources/*`, and `prompts/*` are free)
- **OpenAPI 3.1 Spec:** [openapi.json](https://chart-viz.apikeg.com/openapi.json)
- **Full Schema & Examples:** [llms-full.txt](https://chart-viz.apikeg.com/llms-full.txt)
- **RFC 9727 API Catalog:** [.well-known/api-catalog](https://chart-viz.apikeg.com/.well-known/api-catalog)
- **x402 Bazaar Manifest:** [.well-known/x402.json](https://chart-viz.apikeg.com/.well-known/x402.json)
- **MCP Discovery Manifest:** [.well-known/mcp.json](https://chart-viz.apikeg.com/.well-known/mcp.json)
- **A2A Agent Card:** [.well-known/agent-card.json](https://chart-viz.apikeg.com/.well-known/agent-card.json)
- **Primary Payment (Zero Signup):** Cloudflare Monetization Gateway (`HTTP 402` / `x402` v2 with USDC on Base).
- **Optional Monthly API Key:** Pass `Authorization: Bearer ak_live_...` ($5 / $20 / $50 monthly per-product Stripe plans at [apikeg.com/account](https://apikeg.com/account)).
- **Free Preflight:** Append `?dry_run=true` (or header `X-Dry-Run: true`) to validate any request payload at `$0.00` cost.

## Tools & REST Endpoints
- [`render_chart`](https://chart-viz.apikeg.com/tools/render-chart.md) (`POST https://chart-viz.apikeg.com/v1/render-chart`) — $0.002 USD per rendered executive SVG chart (x402 instant micropayment): Compiles structured business data into a crisp standalone SVG + base64 data URI across bar, stacked_bar, horizontal_bar, line, area, waterfall, funnel, and gantt chart types, returning a verified zero-overlap layoutReport.
- [`render_kpi_card`](https://chart-viz.apikeg.com/tools/render-kpi-card.md) (`POST https://chart-viz.apikeg.com/v1/render-kpi-card`) — $0.001 USD per executive KPI snapshot card (1-6 tiles) (x402 instant micropayment): Renders 1-6 executive KPI summary tiles with formatted headline values ($1.2M, 45.3%), semantic trend pills (+14.2% MoM), and inline SVG sparklines ready for Slack, Notion, Email, PDFs, or slide decks.

## Instant MCP Configuration
```json
{
  "mcpServers": {
    "chart-viz": {
      "type": "streamable-http",
      "url": "https://chart-viz.apikeg.com/mcp"
    }
  }
}
```

## Common Agent Use Cases
- generate standalone SVG chart API for Slack Notion PDF
- executive waterfall bridge chart SVG MCP tool
- KPI summary card with sparklines SVG generator
- conversion funnel and Gantt timeline SVG API
- collision-free chart rendering for AI agents
