Diagram AI
Describe a diagram 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 diagram in plain English (max 1000 chars). Be specific: mention the diagram type, key entities, and relationships.
diagram_type?stringPreferred diagram language. AI chooses if omitted. Examples: "mermaid", "d2", "plantuml", "graphviz".
"mermaid""mermaid""d2""plantuml""graphviz"output_format?stringOutput format. Default: "svg".
"svg""svg""png""jpeg""pdf"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.
falseSuccessful response
response?stringapplication/jsoncurl -X GET 'https://api.chartquery.com/v1/diagram/ai?prompt=string'"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"600\" height=\"400\"> <!-- AI-generated diagram SVG --> </svg>"