Chart AI
Describe a chart in plain English via GET and get a rendered image back. Powered by AI.
Credit cost: 10 credits per call
ApiKeyAuthx-api-key<token>Your API key. Include it in the x-api-key header for every request.
prompt*stringDescribe your chart in plain English (max 1000 chars). Be specific: mention chart type, data topic, colors, style.
raw_data?stringRaw data for the chart. URL-encoded string, CSV, or JSON. AI will parse and structure it.
Examples:
- String:
Jan: 12400, Feb: 18900, Mar: 15200 - JSON array:
[{"month":"Jan","a":120,"b":85},{"month":"Feb","a":145,"b":102}] - JSON object:
{"Organic":38,"Paid":24,"Direct":18}
Limit: 10 000 characters / 500 items. Need more? Open a support ticket.
title?stringOverride the chart title generated by AI.
subtitle?stringOverride the chart subtitle.
legend?stringLegend position or visibility. Use "false" to hide.
"top""top""bottom""left""right""chartArea""false"format?stringOutput format. Default: "png".
"png""png""svg"width?numberImage width in pixels (50–4000). Default: 1200.
height?numberImage height in pixels (50–4000). Default: 600.
background?stringBackground color as a hex value. Default: #ffffff.
device_pixel_ratio?numberDevice pixel ratio for the rendered image. Default: 1.
fields?stringComma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).
is_async?booleanRun the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.
falsesoft_fail?booleanReturn HTTP 200 even when the request fails; the error is in the error field of the body.
falselabels?array<string>Structured X-axis labels. Used as-is by the model.
datasets?array<>Structured Chart.js datasets. Used as-is by the model.
Successful response
response?stringapplication/jsoncurl -X GET 'https://api.chartquery.com/v1/chart/ai?prompt=string'"(binary image/png: use directly in <img src=\"...\"> or download)"