Getting Started

Chart-Output generates pixel-perfect PNG, JPEG, SVG, WebP, and PDF charts via a simple REST API. Use it for emails, PDFs, bots, and automated reports.

Authentication

Anonymous requests (no Authorization header) return 200 at starter plan limits — 401 only fires when an Authorization header is present but invalid. You can also authenticate with a Bearer token or query-string key for higher quotas.

To track usage and access higher quotas, authenticate using one of:

  • API Key (Bearer header) – Create one from the API Keys page in your dashboard. Format: pk_live_... or pk_test_...
  • API Key (query parameter) – Pass ?key=pk_live_... or ?apiKey=pk_live_... in the URL. Required for <img src="..."> email embeds since browsers cannot send headers with image requests.
  • Session JWT – When logged in via the dashboard, your session token is used automatically for same-origin requests.
text
Authorization: Bearer pk_live_YOUR_API_KEY

Your First Render

Send a POST request to /api/v1/render with a chart specification:

bash
curl -X POST https://chart-output.com/api/v1/render \ -H "Authorization: Bearer pk_live_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "line", "width": 800, "height": 400, "format": "png", "data": { "labels": ["Jan", "Feb", "Mar"], "datasets": [{ "label": "Revenue", "data": [12000, 15000, 18000] }] } }' --output chart.png

The response is the raw image bytes. Check the response headers for metadata:

  • X-Render-Time-Ms – Render latency in milliseconds
  • X-CacheHIT or MISS when Redis caching is enabled
  • X-Request-Id – Request ID for debugging and support

Next Steps