{"openapi":"3.1.0","info":{"title":"Chartquery API Reference","description":"Complete API reference documentation.","version":"1.0.0"},"servers":[{"url":"https://api.chartquery.com","description":"API Server"}],"paths":{"/v1/stats":{"get":{"summary":"Stats","description":"Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 means contact support to activate it.","operationId":"stats","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"engine","in":"query","required":false,"description":"API family to check, for example `chart`. Provide at least `engine` or `path`.","schema":{"type":"string","description":"API family to check, for example `chart`. Provide at least `engine` or `path`."}},{"name":"path","in":"query","required":false,"description":"Specific endpoint to check, for example `/v1/chart`. If you also pass `engine`, use an endpoint from that API.","schema":{"type":"string","description":"Specific endpoint to check, for example `/v1/chart`. If you also pass `engine`, use an endpoint from that API."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"nullable":true},"engine":{"type":"string"},"health":{"type":"string"},"window":{"type":"string"},"success_rate":{"type":"number"},"avg_response_time_ms":{"type":"integer"}}},"examples":{"Engine health snapshot":{"value":{"path":null,"engine":"chart","health":"operational","window":"1h","success_rate":99.412,"avg_response_time_ms":840}},"Path health snapshot":{"value":{"path":"/v1/chart","engine":"chart","health":"operational","window":"1h","success_rate":99.412,"avg_response_time_ms":840}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"401":{"description":"Unauthorized — the API key is missing, invalid, inactive, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Invalid API Key"}}}},"402":{"description":"Payment Required — your subscription or credit balance is insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Payment required"}}}},"429":{"description":"Too Many Requests — you exceeded your rate limit quota.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Rate limit exceeded for the API key: quota monthly"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/label/view/{id}":{"get":{"summary":"Label View","description":"View a previously saved label as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.","operationId":"label-view-id","parameters":[{"name":"id","in":"query","required":true,"description":"Label ID from the share response.","schema":{"type":"string","description":"Label ID from the share response."}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"HTML page (rendered label)":{"value":"<!DOCTYPE html><html><!-- rendered label preview embedded in a responsive page --></html>"},"Not found (410)":{"value":{"error":"Label not found or expired."}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/label/render/{id}":{"get":{"summary":"Label Render","description":"Render a previously saved label by ID. Public, no API key required. Supports ?format= override.","operationId":"label-render-id","parameters":[{"name":"id","in":"query","required":true,"description":"Label ID from the share response.","schema":{"type":"string","description":"Label ID from the share response."}},{"name":"format","in":"query","required":false,"description":"Override output format.","schema":{"type":"string","enum":["svg","png"],"default":"svg","description":"Override output format."}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/label/parse":{"post":{"summary":"Label Parse","description":"Parse printer commands into structured elements. POST source and language (tsc, zpl, epl, …).\n\n**Credit cost:** 1 credit per call","operationId":"label-parse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","description":"Raw printer commands to parse. Also send language."},"language":{"type":"string","enum":["tsc","zpl","epl","cpcl","dpl","sbpl","ipl"],"default":"tsc","description":"Language of the source commands. Example: tsc or zpl."}},"required":["source","language"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"dpi":{"type":"integer"},"commands":{"type":"array","items":{"type":"object","properties":{"cmd":{"type":"string"},"unit":{"type":"string"},"widthMM":{"type":"integer"},"heightMM":{"type":"integer"}}}},"elements":{"type":"array","items":{"type":"object","properties":{"x":{"type":"integer"},"y":{"type":"integer"},"font":{"type":"string"},"size":{"type":"integer"},"type":{"type":"string"},"content":{"type":"string"},"rotation":{"type":"integer"}}}},"warnings":{"type":"array","items":{}},"widthDots":{"type":"integer"},"heightDots":{"type":"integer"}}},"examples":{"Parsed TSC result":{"value":{"dpi":203,"commands":[{"cmd":"SIZE","unit":"mm","widthMM":40,"heightMM":30},{"cmd":"CLS"},{"x":10,"y":10,"cmd":"TEXT","font":"2","xMul":1,"yMul":1,"content":"Hello","rotation":0},{"cmd":"PRINT","sets":1}],"elements":[{"x":10,"y":10,"font":"2","size":1,"type":"text","content":"Hello","rotation":0}],"warnings":[],"widthDots":320,"heightDots":240}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/label/validate":{"post":{"summary":"Label Validate","description":"Validate printer commands. POST source (the raw commands) and language (tsc, zpl, epl, …).\n\n**Credit cost:** 1 credit per call","operationId":"label-validate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","description":"Raw printer commands to validate. Also send language."},"language":{"type":"string","enum":["tsc","zpl","epl","cpcl","dpl","sbpl","ipl"],"default":"tsc","description":"Language of the source commands. Example: tsc or zpl."}},"required":["source","language"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"infos":{"type":"integer"},"valid":{"type":"boolean"},"errors":{"type":"integer"},"issues":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string"},"command":{"type":"string"},"message":{"type":"string"}}}},"warnings":{"type":"integer"}}},"examples":{"Validation result with errors":{"value":{"infos":0,"valid":false,"errors":1,"issues":[{"level":"error","command":"TEXT","message":"CLS must appear before label elements"},{"level":"warning","message":"No GAP command found"}],"warnings":1}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/label/convert":{"post":{"summary":"Label Convert","description":"Convert printer commands from one language to another. POST source, from, and to. from is the source language (tsc, zpl, epl, …). to is the target (tsc, zpl, escpos, …).\n\n**Credit cost:** 5 credits per call","operationId":"label-convert","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","description":"Raw printer commands to convert. Also send from and to."},"from":{"type":"string","enum":["tsc","zpl","epl","cpcl","dpl","sbpl","ipl"],"default":"tsc","description":"Source language."},"to":{"type":"string","enum":["tsc","zpl","epl","cpcl","dpl","sbpl","escpos","starprnt","ipl"],"default":"tsc","description":"Target language."},"dpi":{"type":"number","description":"Override DPI on the converted output."},"speed":{"type":"number","description":"Override print speed, 1-18."},"density":{"type":"number","description":"Override print darkness, 0-15."},"copies":{"type":"number","description":"Override copies. Minimum 1."}},"required":["source","from","to"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string"},"from":{"type":"string"},"output":{"type":"string"},"warnings":{"type":"array","items":{}},"width_dots":{"type":"integer"},"height_dots":{"type":"integer"},"elements_count":{"type":"integer"},"output_encoding":{"type":"string"}}},"examples":{"TSC → ZPL conversion":{"value":{"to":"zpl","from":"tsc","output":"^XA\n^PW320\n^LL240\n^FO10,10^A0N,20,20^FDHello World^FS\n^PQ1\n^XZ","warnings":[],"width_dots":320,"height_dots":240,"elements_count":1,"output_encoding":"utf-8"}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/label/compile":{"post":{"summary":"Label Compile","description":"Compile a label to printer commands (tsc, zpl, epl, …). POST width, language, and elements. Text uses content and size (1-10), not text or fontSize. No barcode element. Example: {\"width\":40,\"height\":30,\"unit\":\"mm\",\"language\":\"zpl\",\"elements\":[{\"type\":\"text\",\"content\":\"ACME\",\"x\":10,\"y\":10,\"size\":2},{\"type\":\"text\",\"content\":\"SKU: BOX-12\",\"x\":10,\"y\":35,\"size\":2}]}\n\n**Credit cost:** 3 credits per call","operationId":"label-compile","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"width":{"type":"number","description":"Label width. Required. Default unit is mm. Example: 40. Do not send query instead of width."},"height":{"type":"number","description":"Label height in the same unit. Example: 30. Omit for receipt / continuous mode."},"unit":{"type":"string","enum":["mm","inch","dot"],"default":"mm","description":"Measurement unit for width and height. Default mm. Use mm unless you are working in printer dots."},"dpi":{"type":"number","description":"Printer DPI. Default 203."},"gap":{"type":"number","description":"Gap between labels in mm. Ignored for receipts."},"speed":{"type":"number","description":"Print speed, 1-18."},"density":{"type":"number","description":"Print darkness, 0-15."},"direction":{"type":"number","enum":[0,1],"default":1,"description":"Print direction. 0 = normal, 1 = reversed."},"copies":{"type":"number","description":"Number of copies. Minimum 1."},"printer":{"type":"string","description":"Printer profile id (tsc-te210, zebra-zd420, …)."},"elements":{"type":"array","minItems":1,"description":"Required array. Text items need type=text, content, and size (1-10 magnification). Do not use text, fontSize, or type=barcode. Positions x/y are in dots. Example item: {\"type\":\"text\",\"content\":\"Order: 1042\",\"x\":10,\"y\":10,\"size\":2}.","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text","box","line","circle","ellipse","reverse","erase","raw"],"description":"text, box, line, circle, ellipse, reverse, erase, or raw. Not barcode."},"content":{"type":"string","description":"Required for type=text. Use content, not text."},"x":{"type":"number"},"y":{"type":"number"},"font":{"type":"string"},"size":{"type":"number","description":"Text magnification 1-10. Not a pixel fontSize."},"rotation":{"type":"number","enum":[0,90,180,270]},"bold":{"type":"boolean"},"underline":{"type":"boolean"},"reverse":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right"]},"maxWidth":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"thickness":{"type":"number"},"radius":{"type":"number"},"x1":{"type":"number"},"y1":{"type":"number"},"x2":{"type":"number"},"y2":{"type":"number"},"diameter":{"type":"number"}}}},"language":{"type":"string","enum":["tsc","zpl","epl","cpcl","dpl","sbpl","escpos","starprnt","ipl"],"default":"tsc","description":"Required printer language. Example: zpl or tsc. Do not omit."}},"required":["width","elements","language"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"Compiled TSC commands":{"value":"SIZE 40 mm, 30 mm\nGAP 3 mm, 0\nSPEED 4\nDENSITY 8\nDIRECTION 1\nCLS\nTEXT 10,10,\"2\",0,1,1,\"ACME Corp\"\nTEXT 10,35,\"1\",0,1,1,\"SKU: PRD-00123\"\nBAR 5,55,305,1\nBOX 5,5,315,235,2\nPRINT 1"}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/label":{"post":{"summary":"Label Preview (POST)","description":"Preview a thermal label. POST a JSON object with width and elements. Do not send query. Text items use content and size (1-10 magnification), not text or fontSize. No barcode element; use /v1/barcode. Prefer format png so ChatGPT can display the image. Example: {\"width\":40,\"height\":30,\"unit\":\"mm\",\"language\":\"tsc\",\"format\":\"png\",\"elements\":[{\"type\":\"text\",\"content\":\"Order: 1042\",\"x\":10,\"y\":10,\"size\":2},{\"type\":\"text\",\"content\":\"SKU: BOX-12\",\"x\":10,\"y\":35,\"size\":2}]}\n\n**Credit cost:** 3 credits per call","operationId":"post-label","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"width":{"type":"number","description":"Label width. Required. Default unit is mm. Example: 40. Do not send query instead of width."},"height":{"type":"number","description":"Label height in the same unit. Example: 30. Omit for receipt / continuous mode."},"unit":{"type":"string","enum":["mm","inch","dot"],"default":"mm","description":"Measurement unit for width and height. Default mm. Use mm unless you are working in printer dots."},"dpi":{"type":"number","description":"Printer DPI. Default 203."},"gap":{"type":"number","description":"Gap between labels in mm. Ignored for receipts."},"speed":{"type":"number","description":"Print speed, 1-18."},"density":{"type":"number","description":"Print darkness, 0-15."},"direction":{"type":"number","enum":[0,1],"default":1,"description":"Print direction. 0 = normal, 1 = reversed."},"copies":{"type":"number","description":"Number of copies. Minimum 1."},"printer":{"type":"string","description":"Printer profile id (tsc-te210, zebra-zd420, …)."},"elements":{"type":"array","minItems":1,"description":"Required array. Text items need type=text, content, and size (1-10 magnification). Do not use text, fontSize, or type=barcode. Positions x/y are in dots. Example item: {\"type\":\"text\",\"content\":\"Order: 1042\",\"x\":10,\"y\":10,\"size\":2}.","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text","box","line","circle","ellipse","reverse","erase","raw"],"description":"text, box, line, circle, ellipse, reverse, erase, or raw. Not barcode."},"content":{"type":"string","description":"Required for type=text. Use content, not text."},"x":{"type":"number"},"y":{"type":"number"},"font":{"type":"string"},"size":{"type":"number","description":"Text magnification 1-10. Not a pixel fontSize."},"rotation":{"type":"number","enum":[0,90,180,270]},"bold":{"type":"boolean"},"underline":{"type":"boolean"},"reverse":{"type":"boolean"},"align":{"type":"string","enum":["left","center","right"]},"maxWidth":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"thickness":{"type":"number"},"radius":{"type":"number"},"x1":{"type":"number"},"y1":{"type":"number"},"x2":{"type":"number"},"y2":{"type":"number"},"diameter":{"type":"number"}}}},"language":{"type":"string","enum":["tsc","zpl","epl","cpcl","dpl","sbpl","escpos","starprnt","ipl"],"default":"tsc","description":"Printer language for preview. Default tsc. Example: tsc or zpl."},"format":{"type":"string","enum":["svg","png"],"default":"svg","description":"Use png so ChatGPT can display the image. svg is for download or infinite scale."},"share":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}},"required":["width","elements"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"SVG label preview":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"320\" height=\"240\"><!-- label preview --></svg>"},"Share response":{"value":{"id":"cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","view_url":"https://api.chartquery.com/v1/label/view/cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","embed_url":"<iframe src=\"https://api.chartquery.com/v1/label/view/cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" frameborder=\"0\" width=\"600\" height=\"400\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/label/render/cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}},"get":{"summary":"Label Preview","description":"Preview a thermal label via GET. Pass the same label object as a URL-encoded JSON string in query. Inside that JSON, text items use content and size (1-10), not text or fontSize. Prefer format=png for ChatGPT.\n\n**Credit cost:** 3 credits per call","operationId":"get-label","parameters":[{"name":"format","in":"query","required":false,"description":"Use png so ChatGPT can display the image. svg is for download or infinite scale.","schema":{"type":"string","enum":["svg","png"],"default":"svg","description":"Use png so ChatGPT can display the image. svg is for download or infinite scale."}},{"name":"share","in":"query","required":false,"description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}},{"name":"query","in":"query","required":true,"description":"Full label config as URL-encoded JSON. Must include width and elements. Text items use content and size (1-10), not text or fontSize.","schema":{"type":"string","description":"Full label config as URL-encoded JSON. Must include width and elements. Text items use content and size (1-10), not text or fontSize."}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/usage":{"get":{"summary":"Usage","description":"Return this account's Chartquery usage and credit balance. No body. Requires an API key.","operationId":"usage","security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"packs":{"nullable":true},"period":{"type":"object","properties":{"end":{"type":"string"},"start":{"type":"string"}}},"account":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"}}},"api_key":{"type":"object","properties":{"alias":{"type":"string"},"active":{"type":"boolean"},"quotas":{"type":"object","properties":{"daily":{"nullable":true},"total":{"nullable":true},"weekly":{"nullable":true},"monthly":{"nullable":true}}},"expires":{"nullable":true},"category":{"type":"string"}}},"credits":{"type":"object","properties":{"given":{"type":"integer"},"consumed":{"type":"integer"},"remaining":{"type":"integer"},"percent_used":{"type":"integer"}}},"remaining":{"type":"integer"},"rate_limit":{"type":"object","properties":{"per_minute":{"nullable":true},"per_second":{"nullable":true}}},"total_used":{"type":"integer"},"renewal_date":{"type":"string"},"subscription":{"type":"object","properties":{"used":{"type":"integer"},"total":{"type":"integer"},"remaining":{"type":"integer"},"percent_used":{"type":"integer"}}}}},"examples":{"Account usage overview":{"value":{"packs":null,"period":{"end":"2026-04-25","start":"2026-03-25"},"account":{"name":"Microsoft","slug":"microsoft"},"api_key":{"alias":"my-api-key","active":true,"quotas":{"daily":null,"total":null,"weekly":null,"monthly":null},"expires":null,"category":"development"},"credits":{"given":0,"consumed":0,"remaining":0,"percent_used":0},"remaining":0,"rate_limit":{"per_minute":null,"per_second":null},"total_used":15871,"renewal_date":"2026-04-25","subscription":{"used":15871,"total":50,"remaining":0,"percent_used":31742}}},"Account with one-time packs":{"value":{"packs":{"used":15200000,"count":2,"items":[{"id":"cmhtn…","used":12500000,"title":"Ultimate","total":12500000,"exhausted":true,"remaining":0,"percent_used":100,"purchased_at":"2025-11-10"},{"id":"cmlc9…","used":2700000,"title":"Ultimate","total":12500000,"exhausted":false,"remaining":9800000,"percent_used":21.6,"purchased_at":"2026-02-07"}],"total":25000000,"current":{"id":"cmlc9…","used":2700000,"title":"Ultimate","total":12500000,"exhausted":false,"remaining":9800000,"percent_used":21.6,"purchased_at":"2026-02-07"},"remaining":9800000,"percent_used":60.8,"all_exhausted":false,"current_index":2,"exhausted_count":1},"period":{"end":"2026-10-01","start":"2026-09-01"},"account":{"name":"Microsoft","slug":"microsoft"},"api_key":{"alias":"my-api-key","active":true,"quotas":{"daily":null,"total":null,"weekly":null,"monthly":null},"expires":null,"category":"development"},"credits":{"given":0,"consumed":0,"remaining":0,"percent_used":0},"remaining":9800000,"rate_limit":{"per_minute":null,"per_second":null},"total_used":15200000,"renewal_date":"2026-10-01","subscription":{"used":15200000,"total":25000000,"remaining":9800000,"percent_used":60.8}}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"401":{"description":"Unauthorized — the API key is missing, invalid, inactive, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Invalid API Key"}}}},"402":{"description":"Payment Required — your subscription or credit balance is insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Payment required"}}}},"429":{"description":"Too Many Requests — you exceeded your rate limit quota.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Rate limit exceeded for the API key: quota monthly"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/diagram/ai":{"get":{"summary":"Diagram AI","description":"Describe a diagram in plain English via GET and get a rendered image back. Powered by AI.\n\n**Credit cost:** 10 credits per call","operationId":"get-diagram-ai","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"prompt","in":"query","required":true,"description":"Describe your diagram in plain English (max 1000 chars). Be specific: mention the diagram type, key entities, and relationships.","schema":{"type":"string","description":"Describe your diagram in plain English (max 1000 chars). Be specific: mention the diagram type, key entities, and relationships."}},{"name":"diagram_type","in":"query","required":false,"description":"Preferred diagram language. AI chooses if omitted. Examples: \"mermaid\", \"d2\", \"plantuml\", \"graphviz\".","schema":{"type":"string","enum":["mermaid","d2","plantuml","graphviz"],"default":"mermaid","description":"Preferred diagram language. AI chooses if omitted. Examples: \"mermaid\", \"d2\", \"plantuml\", \"graphviz\"."}},{"name":"output_format","in":"query","required":false,"description":"Output format. Default: \"svg\".","schema":{"type":"string","enum":["svg","png","jpeg","pdf"],"default":"svg","description":"Output format. Default: \"svg\"."}},{"name":"share","in":"query","required":false,"description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry. Paid plan: 6-month expiry.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry. Paid plan: 6-month expiry."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"SVG image (default)":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"600\" height=\"400\"> <!-- AI-generated diagram SVG --> </svg>"},"Shared diagram (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/diagram/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/diagram/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"800\" height=\"500\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/diagram/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}},"Prompt too long (400)":{"value":{"error":"Prompt must not exceed 1000 characters."}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"401":{"description":"Unauthorized — the API key is missing, invalid, inactive, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Invalid API Key"}}}},"402":{"description":"Payment Required — your subscription or credit balance is insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Payment required"}}}},"429":{"description":"Too Many Requests — you exceeded your rate limit quota.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Rate limit exceeded for the API key: quota monthly"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}},"post":{"summary":"Diagram AI (POST)","description":"Generate a diagram from a prompt. POST prompt (5-1000 chars). Optional diagram_type (mermaid, d2, plantuml, graphviz). Use output_format png so ChatGPT can display the image. Example: {\"prompt\":\"Flowchart: start, review, done\",\"diagram_type\":\"mermaid\",\"output_format\":\"png\"}\n\n**Credit cost:** 10 credits per call","operationId":"post-diagram-ai","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","description":"Describe the diagram in plain language (5-1000 chars). Example: Flowchart start, review, done."},"diagram_type":{"type":"string","description":"Preferred diagram language. Optional. Example: mermaid, d2, plantuml, graphviz."},"output_format":{"type":"string","enum":["png","svg","jpeg","pdf"],"default":"png","description":"Use png so ChatGPT can display the image. POST field is output_format, not format."},"share":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}},"required":["prompt"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"SVG image (default)":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"600\" height=\"400\"> <!-- AI-generated diagram SVG --> </svg>"},"Shared diagram (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/diagram/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/diagram/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"800\" height=\"500\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/diagram/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}},"Prompt too long (400)":{"value":{"error":"Prompt must not exceed 1000 characters."}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"401":{"description":"Unauthorized — the API key is missing, invalid, inactive, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Invalid API Key"}}}},"402":{"description":"Payment Required — your subscription or credit balance is insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Payment required"}}}},"429":{"description":"Too Many Requests — you exceeded your rate limit quota.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Rate limit exceeded for the API key: quota monthly"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/diagram/view/{id}":{"get":{"summary":"Diagram View","description":"View a previously saved diagram as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.","operationId":"diagram-view-id","parameters":[{"name":"share","in":"query","required":false,"description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding."}},{"name":"id","in":"path","required":true,"description":"The diagram ID returned in the X-Diagram-View-URL header when saving a diagram. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.","schema":{"type":"string","description":"The diagram ID returned in the X-Diagram-View-URL header when saving a diagram. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"HTML page (rendered diagram)":{"value":"<!DOCTYPE html><html><!-- rendered diagram image embedded in a responsive page --></html>"},"Not found (404)":{"value":{"error":"Diagram not found or expired."}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/qrcode":{"post":{"summary":"QR Code (POST)","description":"Generate a QR code. POST data (URL, text, vCard, WiFi). Use format png so ChatGPT can display it. Example: {\"data\":\"https://example.com\",\"format\":\"png\"}\n\n**Credit cost:** 3 credits per call","operationId":"post-qrcode","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","description":"Chart.js data. Required. Must include datasets (array of {label, data}). Optional labels."},"format":{"type":"string","enum":["svg","png"],"default":"svg","description":"Use png so ChatGPT can display the image. svg is for download or infinite scale."},"share":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."},"size":{"type":"number","description":"Output size. Default 200 when unit is px."},"ec_level":{"type":"string","enum":["L","M","Q","H"],"default":"M","description":"Error correction. Use H with a logo."},"version":{"type":"number","description":"QR version 1-40. Omit for auto."},"mode":{"type":"string","enum":["numeric","alphanumeric","byte","auto"],"default":"auto","description":"Encoding mode. Default auto."},"mask":{"type":"number","description":"Mask pattern 0-7. Omit for auto."},"color":{"type":"object","description":"Module color: hex string or { type, rotation, stops } gradient."},"background":{"type":"object","description":"Background color or gradient."},"margin":{"type":"number","description":"Quiet zone in modules."},"dot_type":{"type":"string","enum":["square","rounded","dots","diamond","classy","classy-rounded","extra-rounded","vertical-line","horizontal-line","small-square","tiny-square"],"default":"square","description":"Module shape. Default square."},"dot_size":{"type":"number","description":"Module size ratio, 0.1-1."},"shape":{"type":"string","enum":["square","circle"],"default":"square","description":"Overall QR shape. Default square."},"corners":{"type":"object","properties":{"top_left":{"type":"object"},"top_right":{"type":"object"},"bottom_left":{"type":"object"}},"description":"Corner styles: top_left, top_right, bottom_left."},"unit":{"type":"string","enum":["px","mm","in","cm"],"default":"px","description":"Measurement unit for width and height. Default mm. Use mm unless you are working in printer dots."},"xml_declaration":{"type":"boolean","enum":["false","true"],"default":"false","description":"Prepend an XML declaration to SVG output."},"aria_label":{"type":"string","description":"SVG aria-label."},"title":{"type":"string","description":"SVG title."},"desc":{"type":"string","description":"SVG description."}},"required":["data"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"SVG QR code (default)":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\" role=\"img\" aria-label=\"QR code\"> <!-- QR modules SVG --> </svg>"},"PNG QR code (format: \"png\")":{"value":"(binary image/png: embed in <img src=\"...\"> or download)"},"Shared QR code (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/qrcode/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/qrcode/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"400\" height=\"400\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/qrcode/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}},"get":{"summary":"QR Code","description":"Generate a styled QR code via GET. Output: SVG (default) or PNG. Supports dot styles, gradients, custom corners and all QR versions.\n\n**Credit cost:** 3 credits per call","operationId":"get-qrcode","parameters":[{"name":"data","in":"query","required":true,"description":"Data to encode in the QR code. Examples:\n\n**URL:** `https://chartquery.com`\n**Email:** `mailto:hello@chartquery.com`\n**Phone:** `tel:+1234567890`\n**SMS:** `SMSTO:+1234567890:Hello!`\n**WiFi:** `WIFI:T:WPA;S:MyNetwork;P:secret123;;`\n**Geo:** `geo:48.8566,2.3522`\n**Plain text:** `Hello from ChartQuery!`\n**vCard:** `BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nEMAIL:john@example.com\nEND:VCARD`","schema":{"type":"string","description":"Data to encode in the QR code. Examples:\n\n**URL:** `https://chartquery.com`\n**Email:** `mailto:hello@chartquery.com`\n**Phone:** `tel:+1234567890`\n**SMS:** `SMSTO:+1234567890:Hello!`\n**WiFi:** `WIFI:T:WPA;S:MyNetwork;P:secret123;;`\n**Geo:** `geo:48.8566,2.3522`\n**Plain text:** `Hello from ChartQuery!`\n**vCard:** `BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nEMAIL:john@example.com\nEND:VCARD`"}},{"name":"size","in":"query","required":false,"description":"Output size in pixels (width = height). Default: 200. Examples: ?size=200 (thumbnail), ?size=300 (standard), ?size=400 (large), ?size=600 (poster). For print, use the unit param with mm/cm instead.","schema":{"type":"number","description":"Output size in pixels (width = height). Default: 200. Examples: ?size=200 (thumbnail), ?size=300 (standard), ?size=400 (large), ?size=600 (poster). For print, use the unit param with mm/cm instead."}},{"name":"ec_level","in":"query","required":false,"description":"Error correction level. Default: M. Higher levels allow more damage/obscuring before the code becomes unreadable.\n\n- **L** (7%): smallest size, minimal redundancy, best for clean environments\n- **M** (15%): balanced, good for most use cases\n- **Q** (25%), for outdoor or rough surfaces\n- **H** (30%): required when adding a logo or image overlay\n\nExample: ?ec_level=H","schema":{"type":"string","enum":["L","M","Q","H"],"default":"M","description":"Error correction level. Default: M. Higher levels allow more damage/obscuring before the code becomes unreadable.\n\n- **L** (7%): smallest size, minimal redundancy, best for clean environments\n- **M** (15%): balanced, good for most use cases\n- **Q** (25%), for outdoor or rough surfaces\n- **H** (30%): required when adding a logo or image overlay\n\nExample: ?ec_level=H"}},{"name":"dot_type","in":"query","required":false,"description":"Module (dot) shape. Default: `square`. Controls the visual style of each QR code module.\n\n- `square`: classic, maximum compatibility\n- `rounded`: softer edges, clean modern look\n- `dots`: fully circular modules, artistic\n- `diamond`: angular style\n- `classy`: elegant angular corners\n- `classy-rounded`: classy with rounded tips\n- `extra-rounded`: large pill-shaped modules\n- `small-square` / `tiny-square`: spaced square modules\n- `vertical-line` / `horizontal-line`: striped effect\n\nExample: ?dot_type=rounded","schema":{"type":"string","enum":["square","rounded","dots","diamond","classy","classy-rounded","extra-rounded","vertical-line","horizontal-line","small-square","tiny-square"],"default":"square","description":"Module (dot) shape. Default: `square`. Controls the visual style of each QR code module.\n\n- `square`: classic, maximum compatibility\n- `rounded`: softer edges, clean modern look\n- `dots`: fully circular modules, artistic\n- `diamond`: angular style\n- `classy`: elegant angular corners\n- `classy-rounded`: classy with rounded tips\n- `extra-rounded`: large pill-shaped modules\n- `small-square` / `tiny-square`: spaced square modules\n- `vertical-line` / `horizontal-line`: striped effect\n\nExample: ?dot_type=rounded"}},{"name":"color","in":"query","required":false,"description":"Module color as CSS hex. Default: #000. Examples: ?color=%236366f1 (indigo), ?color=%23dc2626 (red), ?color=%23059669 (green), ?color=%230891b2 (teal). Use %23 to URL-encode #. For gradient objects, use POST instead.","schema":{"type":"string","description":"Module color as CSS hex. Default: #000. Examples: ?color=%236366f1 (indigo), ?color=%23dc2626 (red), ?color=%23059669 (green), ?color=%230891b2 (teal). Use %23 to URL-encode #. For gradient objects, use POST instead."}},{"name":"shape","in":"query","required":false,"description":"Overall QR code shape. Default: square. Use circle to clip the entire QR into a circle: great for profile/avatar-style codes. Example: ?shape=circle&dot_type=dots","schema":{"type":"string","enum":["square","circle"],"default":"square","description":"Overall QR code shape. Default: square. Use circle to clip the entire QR into a circle: great for profile/avatar-style codes. Example: ?shape=circle&dot_type=dots"}},{"name":"dot_size","in":"query","required":false,"description":"Module size ratio between 0.1 and 1. Default: 1 (full). Values below 1 add spacing between modules for a lighter look. Example: ?dot_size=0.85","schema":{"type":"number","description":"Module size ratio between 0.1 and 1. Default: 1 (full). Values below 1 add spacing between modules for a lighter look. Example: ?dot_size=0.85"}},{"name":"background","in":"query","required":false,"description":"Background color. Default: #fff. Set to transparent for no background. Example: ?background=%230f172a for dark background. Use %23 to encode #.","schema":{"type":"string","description":"Background color. Default: #fff. Set to transparent for no background. Example: ?background=%230f172a for dark background. Use %23 to encode #."}},{"name":"margin","in":"query","required":false,"description":"Quiet zone width in modules around the QR code. Default: 4. Minimum recommended by the QR standard: 4. Example: ?margin=2 (compact) or ?margin=6 (extra padding).","schema":{"type":"number","description":"Quiet zone width in modules around the QR code. Default: 4. Minimum recommended by the QR standard: 4. Example: ?margin=2 (compact) or ?margin=6 (extra padding)."}},{"name":"version","in":"query","required":false,"description":"QR version from 1 to 40 (determines grid size and data capacity). Leave unset for auto-selection based on data length and ec_level. Example: ?version=5","schema":{"type":"number","description":"QR version from 1 to 40 (determines grid size and data capacity). Leave unset for auto-selection based on data length and ec_level. Example: ?version=5"}},{"name":"mode","in":"query","required":false,"description":"Encoding mode. Default: auto (best mode selected for the data). Use numeric for digits-only, alphanumeric for uppercase + digits, byte for arbitrary text/UTF-8. Example: ?mode=numeric","schema":{"type":"string","enum":["auto","numeric","alphanumeric","byte"],"default":"auto","description":"Encoding mode. Default: auto (best mode selected for the data). Use numeric for digits-only, alphanumeric for uppercase + digits, byte for arbitrary text/UTF-8. Example: ?mode=numeric"}},{"name":"mask","in":"query","required":false,"description":"Mask pattern from 0 to 7. Default: auto (best mask selected to minimize visual patterns). Only set manually if you need a deterministic output. Example: ?mask=3","schema":{"type":"number","description":"Mask pattern from 0 to 7. Default: auto (best mask selected to minimize visual patterns). Only set manually if you need a deterministic output. Example: ?mask=3"}},{"name":"unit","in":"query","required":false,"description":"Measurement unit for the size param. Default: px. Use mm, in or cm with the size param for print-ready output. Example: ?size=50&unit=mm","schema":{"type":"string","enum":["px","mm","in","cm"],"default":"px","description":"Measurement unit for the size param. Default: px. Use mm, in or cm with the size param for print-ready output. Example: ?size=50&unit=mm"}},{"name":"xml_declaration","in":"query","required":false,"description":"Prepend an XML declaration (<?xml version=\"1.0\" encoding=\"UTF-8\"?>) to the SVG output. Useful when the SVG will be used as a standalone XML file. Default: false. Example: ?xml_declaration=true","schema":{"type":"boolean","description":"Prepend an XML declaration (<?xml version=\"1.0\" encoding=\"UTF-8\"?>) to the SVG output. Useful when the SVG will be used as a standalone XML file. Default: false. Example: ?xml_declaration=true"}},{"name":"aria_label","in":"query","required":false,"description":"Accessible label added as aria-label on the SVG element. Example: ?aria_label=QR+code+linking+to+chartquery.com","schema":{"type":"string","description":"Accessible label added as aria-label on the SVG element. Example: ?aria_label=QR+code+linking+to+chartquery.com"}},{"name":"title","in":"query","required":false,"description":"SVG <title> element shown as a browser tooltip and used by screen readers. Example: ?title=ChartQuery+Website","schema":{"type":"string","description":"SVG <title> element shown as a browser tooltip and used by screen readers. Example: ?title=ChartQuery+Website"}},{"name":"desc","in":"query","required":false,"description":"SVG <desc> element for extended accessibility description. Example: ?desc=Scan+to+visit+https://chartquery.com","schema":{"type":"string","description":"SVG <desc> element for extended accessibility description. Example: ?desc=Scan+to+visit+https://chartquery.com"}},{"name":"format","in":"query","required":false,"description":"Output format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png","schema":{"type":"string","enum":["svg","png"],"default":"svg","description":"Output format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png"}},{"name":"share","in":"query","required":false,"description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding."}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/barcode":{"post":{"summary":"Barcode (POST)","description":"Generate a barcode. POST data. Default type is code128. Use format png so ChatGPT can display it. Example: {\"data\":\"ORDER-1042\",\"type\":\"code128\",\"format\":\"png\"}\n\n**Credit cost:** 3 credits per call","operationId":"post-barcode","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","description":"Chart.js data. Required. Must include datasets (array of {label, data}). Optional labels."},"type":{"type":"string","enum":["code128","code39","code39ext","code93","code93ext","ean13","ean8","ean5","ean2","upca","upce","itf","itf14","codabar","msi","pharmacode","code11","gs1-128","gs1-databar","gs1-databar-limited","gs1-databar-expanded","identcode","leitcode","postnet","planet","plessey"],"default":"code128","description":"Barcode format. Default code128. Example: code128 or ean13."},"format":{"type":"string","enum":["svg","png"],"default":"svg","description":"Use png so ChatGPT can display the image. svg is for download or infinite scale."},"share":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."},"height":{"type":"number","description":"Label height in the same unit. Example: 30 for 30mm. Omit for receipt / continuous mode."},"bar_width":{"type":"number","description":"Module width multiplier."},"color":{"type":"string","description":"Bar color."},"background":{"type":"string","description":"Background color."},"show_text":{"type":"boolean","enum":["false","true"],"default":"false","description":"Show human-readable text."},"text_position":{"type":"string","enum":["bottom","top"],"default":"bottom","description":"Text position. Default bottom."},"font_size":{"type":"number","description":"Text label font size."},"font_family":{"type":"string","description":"Text label font family."},"margin":{"type":"number","description":"Uniform margin. Overridden by per-side margins."},"margin_top":{"type":"number","description":"Top margin."},"margin_bottom":{"type":"number","description":"Bottom margin."},"margin_left":{"type":"number","description":"Left margin."},"margin_right":{"type":"number","description":"Right margin."},"text_align":{"type":"string","enum":["center","left","right"],"default":"center","description":"Text alignment. Default center."},"rotation":{"type":"number","enum":[0,90,180,270],"description":"Rotation in degrees."},"bearer_bars":{"type":"boolean","enum":["false","true"],"default":"false","description":"Add bearer bars. Required for ITF-14."},"bar_gap":{"type":"number","description":"Extra spacing between bars."},"unit":{"type":"string","enum":["px","mm","in","cm"],"default":"px","description":"Measurement unit for width and height. Default mm. Use mm unless you are working in printer dots."},"aria_label":{"type":"string","description":"SVG aria-label."},"title":{"type":"string","description":"SVG title."},"desc":{"type":"string","description":"SVG description."}},"required":["data"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"SVG barcode (default)":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"220\" height=\"100\" role=\"img\" aria-label=\"EAN-13 barcode\"> <!-- barcode SVG bars --> </svg>"},"PNG barcode (format: \"png\")":{"value":"(binary image/png: embed in <img src=\"...\"> or download)"},"Shared barcode (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/barcode/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/barcode/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"400\" height=\"200\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/barcode/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}},"get":{"summary":"Barcode","description":"Generate a barcode image via GET. Output: SVG (default) or PNG. Supports 25+ formats: EAN-13, Code 128, ITF-14, GS1-128, postal codes and more.\n\n**Credit cost:** 3 credits per call","operationId":"get-barcode","parameters":[{"name":"data","in":"query","required":true,"description":"The data to encode in the barcode. Examples by type:\n\n**EAN-13** (retail): `4006381333931`\n**EAN-8** (small pack): `73513537`\n**UPC-A** (North America): `012345678905`\n**Code 128** (general): `HELLO-WORLD-2026` or `INV-2026-00456`\n**Code 39** (uppercase): `CODE39-DEMO` or `SHELF-A12`\n**ITF-14** (carton): `00012345678905`\n**GS1-128** (with AIs): `(01)12345678901231(17)260101`\n**Codabar** (library): `A1234567890B`\n**POSTNET** (postal): `902100123`","schema":{"type":"string","description":"The data to encode in the barcode. Examples by type:\n\n**EAN-13** (retail): `4006381333931`\n**EAN-8** (small pack): `73513537`\n**UPC-A** (North America): `012345678905`\n**Code 128** (general): `HELLO-WORLD-2026` or `INV-2026-00456`\n**Code 39** (uppercase): `CODE39-DEMO` or `SHELF-A12`\n**ITF-14** (carton): `00012345678905`\n**GS1-128** (with AIs): `(01)12345678901231(17)260101`\n**Codabar** (library): `A1234567890B`\n**POSTNET** (postal): `902100123`"}},{"name":"type","in":"query","required":false,"description":"Barcode format. Default: `code128`.\n\n**Retail:** `ean13`, `ean8`, `ean5`, `ean2`, `upca`, `upce`\n**General:** `code128`, `code39`, `code39ext`, `code93`, `code93ext`\n**Logistics:** `itf`, `itf14`, `gs1-128`, `gs1-databar`, `gs1-databar-limited`, `gs1-databar-expanded`\n**Other:** `codabar`, `msi`, `pharmacode`, `code11`, `plessey`\n**Postal:** `postnet`, `planet`, `identcode`, `leitcode`","schema":{"type":"string","enum":["code128","code39","code39ext","code93","code93ext","ean13","ean8","ean5","ean2","upca","upce","itf","itf14","codabar","msi","pharmacode","code11","gs1-128","gs1-databar","gs1-databar-limited","gs1-databar-expanded","identcode","leitcode","postnet","planet","plessey"],"default":"code128","description":"Barcode format. Default: `code128`.\n\n**Retail:** `ean13`, `ean8`, `ean5`, `ean2`, `upca`, `upce`\n**General:** `code128`, `code39`, `code39ext`, `code93`, `code93ext`\n**Logistics:** `itf`, `itf14`, `gs1-128`, `gs1-databar`, `gs1-databar-limited`, `gs1-databar-expanded`\n**Other:** `codabar`, `msi`, `pharmacode`, `code11`, `plessey`\n**Postal:** `postnet`, `planet`, `identcode`, `leitcode`"}},{"name":"height","in":"query","required":false,"description":"Bar height in pixels. Default: 80. Typical values: 50 (compact), 80 (standard), 100–120 (tall labels). Example: ?height=100","schema":{"type":"number","description":"Bar height in pixels. Default: 80. Typical values: 50 (compact), 80 (standard), 100–120 (tall labels). Example: ?height=100"}},{"name":"color","in":"query","required":false,"description":"Bar color as a CSS color string. Default: #000. Examples: ?color=%231e293b (dark slate), ?color=%230f172a (near black), ?color=%237c3aed (purple), ?color=%23dc2626 (red). Use %23 to URL-encode the # character.","schema":{"type":"string","description":"Bar color as a CSS color string. Default: #000. Examples: ?color=%231e293b (dark slate), ?color=%230f172a (near black), ?color=%237c3aed (purple), ?color=%23dc2626 (red). Use %23 to URL-encode the # character."}},{"name":"show_text","in":"query","required":false,"description":"Show human-readable text below the bars. Example: ?show_text=true. Combine with font_size and text_align for print labels.","schema":{"type":"boolean","description":"Show human-readable text below the bars. Example: ?show_text=true. Combine with font_size and text_align for print labels."}},{"name":"text_position","in":"query","required":false,"description":"Position of the human-readable text label. Default: bottom. Example: ?text_position=top","schema":{"type":"string","enum":["bottom","top"],"default":"bottom","description":"Position of the human-readable text label. Default: bottom. Example: ?text_position=top"}},{"name":"text_align","in":"query","required":false,"description":"Horizontal alignment of the text label. Default: center. Example: ?text_align=left","schema":{"type":"string","enum":["center","left","right"],"default":"center","description":"Horizontal alignment of the text label. Default: center. Example: ?text_align=left"}},{"name":"font_size","in":"query","required":false,"description":"Font size of the text label in pixels. Default: 14. Example: ?font_size=12","schema":{"type":"number","description":"Font size of the text label in pixels. Default: 14. Example: ?font_size=12"}},{"name":"font_family","in":"query","required":false,"description":"Font family of the text label. Default: monospace. Examples: ?font_family=monospace, ?font_family=sans-serif, ?font_family=Arial","schema":{"type":"string","description":"Font family of the text label. Default: monospace. Examples: ?font_family=monospace, ?font_family=sans-serif, ?font_family=Arial"}},{"name":"bar_width","in":"query","required":false,"description":"Width multiplier per module (bar). Default: 2. Increase for wider, more scannable barcodes. Example: ?bar_width=3","schema":{"type":"number","description":"Width multiplier per module (bar). Default: 2. Increase for wider, more scannable barcodes. Example: ?bar_width=3"}},{"name":"bar_gap","in":"query","required":false,"description":"Extra horizontal spacing between bars in pixels. Default: 0. Example: ?bar_gap=1","schema":{"type":"number","description":"Extra horizontal spacing between bars in pixels. Default: 0. Example: ?bar_gap=1"}},{"name":"background","in":"query","required":false,"description":"Background fill color. Default: #fff. Use transparent for no background. Example: ?background=%23f8fafc","schema":{"type":"string","description":"Background fill color. Default: #fff. Use transparent for no background. Example: ?background=%23f8fafc"}},{"name":"margin","in":"query","required":false,"description":"Uniform margin around the barcode in pixels. Default: 10. Overridden per side by margin_top/bottom/left/right. Example: ?margin=6","schema":{"type":"number","description":"Uniform margin around the barcode in pixels. Default: 10. Overridden per side by margin_top/bottom/left/right. Example: ?margin=6"}},{"name":"margin_top","in":"query","required":false,"description":"Top margin in pixels (overrides margin). Example: ?margin_top=4","schema":{"type":"number","description":"Top margin in pixels (overrides margin). Example: ?margin_top=4"}},{"name":"margin_bottom","in":"query","required":false,"description":"Bottom margin in pixels (overrides margin). Example: ?margin_bottom=4","schema":{"type":"number","description":"Bottom margin in pixels (overrides margin). Example: ?margin_bottom=4"}},{"name":"margin_left","in":"query","required":false,"description":"Left margin in pixels (overrides margin). Example: ?margin_left=8","schema":{"type":"number","description":"Left margin in pixels (overrides margin). Example: ?margin_left=8"}},{"name":"margin_right","in":"query","required":false,"description":"Right margin in pixels (overrides margin). Example: ?margin_right=8","schema":{"type":"number","description":"Right margin in pixels (overrides margin). Example: ?margin_right=8"}},{"name":"rotation","in":"query","required":false,"description":"Rotate the barcode by 0, 90, 180 or 270 degrees. Default: 0. Use 90 or 270 for vertical label orientation. Example: ?rotation=90","schema":{"type":"number","enum":[0,90,180,270],"description":"Rotate the barcode by 0, 90, 180 or 270 degrees. Default: 0. Use 90 or 270 for vertical label orientation. Example: ?rotation=90"}},{"name":"bearer_bars","in":"query","required":false,"description":"Add horizontal bearer bars above and below the barcode. Required for ITF-14. Default: false. Example: ?bearer_bars=true","schema":{"type":"boolean","description":"Add horizontal bearer bars above and below the barcode. Required for ITF-14. Default: false. Example: ?bearer_bars=true"}},{"name":"unit","in":"query","required":false,"description":"Measurement unit for dimensions. Default: px. Use mm, in or cm for print-ready output. Example: ?unit=mm","schema":{"type":"string","enum":["px","mm","in","cm"],"default":"px","description":"Measurement unit for dimensions. Default: px. Use mm, in or cm for print-ready output. Example: ?unit=mm"}},{"name":"aria_label","in":"query","required":false,"description":"Accessible label added as aria-label on the SVG element. Improves screen reader support. Example: ?aria_label=EAN-13+barcode+for+product+4006381333931","schema":{"type":"string","description":"Accessible label added as aria-label on the SVG element. Improves screen reader support. Example: ?aria_label=EAN-13+barcode+for+product+4006381333931"}},{"name":"title","in":"query","required":false,"description":"SVG <title> element for tooltip and accessibility. Example: ?title=Product+Barcode","schema":{"type":"string","description":"SVG <title> element for tooltip and accessibility. Example: ?title=Product+Barcode"}},{"name":"desc","in":"query","required":false,"description":"SVG <desc> element for extended accessibility description. Example: ?desc=EAN-13+encoding+GTIN+for+Nivea+cream+75ml","schema":{"type":"string","description":"SVG <desc> element for extended accessibility description. Example: ?desc=EAN-13+encoding+GTIN+for+Nivea+cream+75ml"}},{"name":"format","in":"query","required":false,"description":"Output format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png","schema":{"type":"string","enum":["svg","png"],"default":"svg","description":"Output format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png"}},{"name":"share","in":"query","required":false,"description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding."}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/chart/view/{id}":{"get":{"summary":"Chart View","description":"View a previously saved chart as an interactive HTML page. Public, no API key required. Iframe-embeddable.","operationId":"chart-view-id","parameters":[{"name":"share","in":"query","required":false,"description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding."}},{"name":"id","in":"path","required":true,"description":"The chart ID returned in the X-Chart-View-URL header when saving a chart. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.","schema":{"type":"string","description":"The chart ID returned in the X-Chart-View-URL header when saving a chart. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"HTML page (interactive chart)":{"value":"<!DOCTYPE html><html><!-- interactive chart canvas, responsive, tooltip-enabled --></html>"},"Not found (404)":{"value":{"error":"Chart not found or expired."}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/diagram/render/{id}":{"get":{"summary":"Diagram Render","description":"Render a previously saved diagram by ID. Public, no API key required. Supports ?format= and ?query= overrides.","operationId":"diagram-render-id","parameters":[{"name":"format","in":"query","required":false,"description":"Override output format.","schema":{"type":"string","enum":["svg","png","jpeg","pdf"],"default":"svg","description":"Override output format."}},{"name":"query","in":"query","required":false,"description":"Override the diagram source code (URL-encoded).","schema":{"type":"string","description":"Override the diagram source code (URL-encoded)."}},{"name":"share","in":"query","required":false,"description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding."}},{"name":"id","in":"path","required":true,"description":"The diagram ID returned in the X-Diagram-Render-URL header when saving a diagram. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.","schema":{"type":"string","description":"The diagram ID returned in the X-Diagram-Render-URL header when saving a diagram. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx."}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/chart/render/{id}":{"get":{"summary":"Chart Render","description":"Render a previously saved chart by ID. Public, no API key required. Supports URL overrides for templates (?data1=, ?labels=, ?title=…).","operationId":"chart-render-id","parameters":[{"name":"title","in":"query","required":false,"description":"Override the chart title.","schema":{"type":"string","description":"Override the chart title."}},{"name":"labels","in":"query","required":false,"description":"Override X-axis labels. Comma-separated.","schema":{"type":"string","description":"Override X-axis labels. Comma-separated."}},{"name":"data1","in":"query","required":false,"description":"Override first dataset values. Comma-separated numbers. Use data2, data3… for additional datasets.","schema":{"type":"string","description":"Override first dataset values. Comma-separated numbers. Use data2, data3… for additional datasets."}},{"name":"width","in":"query","required":false,"description":"Override output width in pixels (50–4000).","schema":{"type":"string","description":"Override output width in pixels (50–4000)."}},{"name":"height","in":"query","required":false,"description":"Override output height in pixels (50–4000).","schema":{"type":"string","description":"Override output height in pixels (50–4000)."}},{"name":"format","in":"query","required":false,"description":"Override output format.","schema":{"type":"string","enum":["png","svg"],"default":"png","description":"Override output format."}},{"name":"id","in":"path","required":true,"description":"The chart ID returned in the X-Chart-Render-URL header when saving a chart. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.","schema":{"type":"string","description":"The chart ID returned in the X-Chart-Render-URL header when saving a chart. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx."}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/chart/ai":{"post":{"summary":"Chart AI (POST)","description":"Generate a chart from a prompt. POST prompt (5-1000 chars). Optional raw_data and title. Use format png so ChatGPT can display the image. Example: {\"prompt\":\"Bar chart of Q1 revenue: Jan 12, Feb 15, Mar 9\",\"format\":\"png\"}\n\n**Credit cost:** 10 credits per call","operationId":"post-chart-ai","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","description":"Describe the chart in plain language (5-1000 chars). Example: Bar chart of Q1 revenue: Jan 12, Feb 15, Mar 9."},"labels":{"type":"array","items":{"type":"string"},"description":"Structured X-axis labels. Used as-is by the model."},"datasets":{"type":"array","items":{"type":"object","required":["data"],"properties":{"label":{"type":"string"},"data":{"type":"array"},"type":{"type":"string"},"fill":{},"tension":{"type":"number"},"stepped":{},"borderDash":{"type":"array","items":{"type":"number"}},"backgroundColor":{},"borderColor":{},"borderWidth":{},"pointRadius":{},"pointStyle":{"type":"string"},"pointBackgroundColor":{},"pointBorderColor":{},"yAxisID":{"type":"string"},"xAxisID":{"type":"string"},"stack":{"type":"string"},"order":{"type":"number"},"hidden":{"type":"boolean"}}},"description":"Structured Chart.js datasets. Used as-is by the model."},"raw_data":{"type":"object","description":"Unstructured data: string (max 10000), array (max 500), or object."},"title":{"type":"string","description":"Override the generated title."},"subtitle":{"type":"string","description":"Override the generated subtitle."},"legend":{"type":"string","enum":["top","bottom","left","right","chartArea","false"],"default":"top","description":"Legend position, or false to hide."},"format":{"type":"string","enum":["png","svg"],"default":"png","description":"Use png so ChatGPT can display the image. svg is for download or infinite scale."},"width":{"type":"number","description":"Output width in pixels, 50-4000."},"height":{"type":"number","description":"Output height in pixels, 50-4000."},"background":{"type":"string","description":"Background color."},"device_pixel_ratio":{"type":"number","description":"Device pixel ratio, 0.5-4."},"share":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}},"required":["prompt"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"PNG image":{"value":"(binary image/png: use directly in <img src=\"...\"> or download)"},"SVG image (format: \"svg\")":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"800\" height=\"400\"> <!-- AI-generated chart SVG --> </svg>"},"Shared chart (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/chart/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/chart/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"800\" height=\"500\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/chart/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}},"Prompt too long (400)":{"value":{"error":"Prompt must not exceed 1000 characters."}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"401":{"description":"Unauthorized — the API key is missing, invalid, inactive, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Invalid API Key"}}}},"402":{"description":"Payment Required — your subscription or credit balance is insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Payment required"}}}},"429":{"description":"Too Many Requests — you exceeded your rate limit quota.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Rate limit exceeded for the API key: quota monthly"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}},"get":{"summary":"Chart AI","description":"Describe a chart in plain English via GET and get a rendered image back. Powered by AI.\n\n**Credit cost:** 10 credits per call","operationId":"get-chart-ai","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"prompt","in":"query","required":true,"description":"Describe your chart in plain English (max 1000 chars). Be specific: mention chart type, data topic, colors, style.","schema":{"type":"string","description":"Describe your chart in plain English (max 1000 chars). Be specific: mention chart type, data topic, colors, style."}},{"name":"raw_data","in":"query","required":false,"description":"Raw data for the chart. URL-encoded string, CSV, or JSON. AI will parse and structure it.\n\nExamples:\n- String: `Jan: 12400, Feb: 18900, Mar: 15200`\n- JSON array: `[{\"month\":\"Jan\",\"a\":120,\"b\":85},{\"month\":\"Feb\",\"a\":145,\"b\":102}]`\n- JSON object: `{\"Organic\":38,\"Paid\":24,\"Direct\":18}`\n\nLimit: 10 000 characters / 500 items. Need more? Open a support ticket.","schema":{"type":"string","description":"Raw data for the chart. URL-encoded string, CSV, or JSON. AI will parse and structure it.\n\nExamples:\n- String: `Jan: 12400, Feb: 18900, Mar: 15200`\n- JSON array: `[{\"month\":\"Jan\",\"a\":120,\"b\":85},{\"month\":\"Feb\",\"a\":145,\"b\":102}]`\n- JSON object: `{\"Organic\":38,\"Paid\":24,\"Direct\":18}`\n\nLimit: 10 000 characters / 500 items. Need more? Open a support ticket."}},{"name":"title","in":"query","required":false,"description":"Override the chart title generated by AI.","schema":{"type":"string","description":"Override the chart title generated by AI."}},{"name":"subtitle","in":"query","required":false,"description":"Override the chart subtitle.","schema":{"type":"string","description":"Override the chart subtitle."}},{"name":"legend","in":"query","required":false,"description":"Legend position or visibility. Use \"false\" to hide.","schema":{"type":"string","enum":["top","bottom","left","right","chartArea","false"],"default":"top","description":"Legend position or visibility. Use \"false\" to hide."}},{"name":"format","in":"query","required":false,"description":"Output format. Default: \"png\".","schema":{"type":"string","enum":["png","svg"],"default":"png","description":"Output format. Default: \"png\"."}},{"name":"width","in":"query","required":false,"description":"Image width in pixels (50–4000). Default: 1200.","schema":{"type":"number","description":"Image width in pixels (50–4000). Default: 1200."}},{"name":"height","in":"query","required":false,"description":"Image height in pixels (50–4000). Default: 600.","schema":{"type":"number","description":"Image height in pixels (50–4000). Default: 600."}},{"name":"background","in":"query","required":false,"description":"Background color as a hex value. Default: #ffffff.","schema":{"type":"string","description":"Background color as a hex value. Default: #ffffff."}},{"name":"device_pixel_ratio","in":"query","required":false,"description":"Device pixel ratio for the rendered image. Default: 1.","schema":{"type":"number","description":"Device pixel ratio for the rendered image. Default: 1."}},{"name":"share","in":"query","required":false,"description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding.","schema":{"type":"boolean","enum":["false","true"],"default":"false","description":"Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"PNG image":{"value":"(binary image/png: use directly in <img src=\"...\"> or download)"},"SVG image (format: \"svg\")":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"800\" height=\"400\"> <!-- AI-generated chart SVG --> </svg>"},"Shared chart (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/chart/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/chart/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"800\" height=\"500\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/chart/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}},"Prompt too long (400)":{"value":{"error":"Prompt must not exceed 1000 characters."}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"401":{"description":"Unauthorized — the API key is missing, invalid, inactive, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Invalid API Key"}}}},"402":{"description":"Payment Required — your subscription or credit balance is insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Payment required"}}}},"429":{"description":"Too Many Requests — you exceeded your rate limit quota.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Rate limit exceeded for the API key: quota monthly"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/diagram":{"post":{"summary":"Diagram (POST)","description":"Render a diagram. POST diagram_type and diagram_source. Do not send type, query, or format. Use output_format png so ChatGPT can display the image. Example: {\"diagram_type\":\"mermaid\",\"diagram_source\":\"graph TD; Start-->Review-->Done\",\"output_format\":\"png\"}\n\n**Credit cost:** 5 credits per call","operationId":"post-diagram","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"diagram_type":{"type":"string","enum":["blockdiag","bpmn","bytefield","seqdiag","actdiag","nwdiag","packetdiag","rackdiag","c4plantuml","d2","dbml","ditaa","erd","excalidraw","graphviz","mermaid","nomnoml","pikchr","plantuml","structurizr","svgbob","symbolator","tikz","umlet","vega","vegalite","wavedrom","wireviz"],"default":"blockdiag","description":"Diagram language. POST field is diagram_type, not type. Example: mermaid."},"diagram_source":{"type":"string","description":"Diagram source code. POST field is diagram_source, not query. Example: graph TD; A-->B"},"output_format":{"type":"string","enum":["png","svg","jpeg","pdf"],"default":"svg","description":"Use png so ChatGPT can display the image. POST field is output_format, not format."},"share":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}},"required":["diagram_type","diagram_source"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"SVG image (default)":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"600\" height=\"400\"> <!-- diagram SVG --> </svg>"},"PNG image (output_format: \"png\")":{"value":"(binary image/png: display in <img> or download)"},"Shared diagram (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/diagram/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/diagram/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"800\" height=\"500\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/diagram/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}},"get":{"summary":"Diagram","description":"Render a diagram via GET. Use type (mermaid, d2, …), query (source code), and format=png for ChatGPT. POST uses diagram_type and diagram_source instead.\n\n**Credit cost:** 5 credits per call","operationId":"get-diagram","parameters":[{"name":"type","in":"query","required":true,"description":"Diagram language.","schema":{"type":"string","enum":["mermaid","graphviz","plantuml","d2","svgbob","nomnoml","blockdiag","seqdiag","actdiag","nwdiag","bpmn","erd","excalidraw","ditaa","vega","vegalite","wavedrom","wireviz","c4plantuml","structurizr","tikz","pikchr","umlet","symbolator","packetdiag","rackdiag","bytefield","dbml"],"default":"mermaid","description":"Diagram language."}},{"name":"query","in":"query","required":true,"description":"Diagram source code (URL-encoded).\n\n**mermaid**: flowchart:\n`graph TD\\n  A[Start] --> B{OK?}\\n  B -->|yes| C[End]\\n  B -->|no| D[Error]`\n\n**mermaid**: sequence:\n`sequenceDiagram\\n  Client->>API: GET /v1/diagram\\n  API-->>Client: 200 SVG`\n\n**mermaid**: ER:\n`erDiagram\\n  USER ||--o{ ORDER : places\\n  ORDER ||--|{ ITEM : contains`\n\n**graphviz**:\n`digraph G { rankdir=LR; A -> B -> C }`\n\n**plantuml**:\n`@startuml\\nA -> B: request\\nB --> A: response\\n@enduml`\n\n**d2**:\n`Client -> API: POST /v1/diagram\\nAPI -> SVG`\n\n**svgbob**:\n`+-------+   +-------+\\n| Box A |-->| Box B |\\n+-------+   +-------+`\n\n**nomnoml**:\n`[Client] -> [API]\\n[API] -> [Handler]`","schema":{"type":"string","description":"Diagram source code (URL-encoded).\n\n**mermaid**: flowchart:\n`graph TD\\n  A[Start] --> B{OK?}\\n  B -->|yes| C[End]\\n  B -->|no| D[Error]`\n\n**mermaid**: sequence:\n`sequenceDiagram\\n  Client->>API: GET /v1/diagram\\n  API-->>Client: 200 SVG`\n\n**mermaid**: ER:\n`erDiagram\\n  USER ||--o{ ORDER : places\\n  ORDER ||--|{ ITEM : contains`\n\n**graphviz**:\n`digraph G { rankdir=LR; A -> B -> C }`\n\n**plantuml**:\n`@startuml\\nA -> B: request\\nB --> A: response\\n@enduml`\n\n**d2**:\n`Client -> API: POST /v1/diagram\\nAPI -> SVG`\n\n**svgbob**:\n`+-------+   +-------+\\n| Box A |-->| Box B |\\n+-------+   +-------+`\n\n**nomnoml**:\n`[Client] -> [API]\\n[API] -> [Handler]`"}},{"name":"format","in":"query","required":false,"description":"Use png so ChatGPT can display the image. svg is for download or infinite scale.","schema":{"type":"string","enum":["svg","png","jpeg","pdf"],"default":"svg","description":"Use png so ChatGPT can display the image. svg is for download or infinite scale."}},{"name":"share","in":"query","required":false,"description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image.","schema":{"type":"boolean","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}},"/v1/chart":{"post":{"summary":"Chart (POST)","description":"Render a Chart.js image. POST type and data with datasets. Do not wrap the config in query. Use format png so ChatGPT can display the image. Example: {\"type\":\"bar\",\"title\":\"Q1 revenue\",\"format\":\"png\",\"data\":{\"labels\":[\"Jan\",\"Feb\",\"Mar\"],\"datasets\":[{\"label\":\"Revenue\",\"data\":[12,15,9]}]}}\n\n**Credit cost:** 5 credits per call","operationId":"post-chart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["area","bar","bubble","doughnut","pie","line","mixed","polarArea","radar","scatter"],"default":"area","description":"Chart.js type. Required. Example: bar, line, pie. This is not a diagram type."},"data":{"type":"object","required":["datasets"],"properties":{"labels":{"type":"array","items":{"type":"string"}},"datasets":{"type":"array","items":{"type":"object","required":["data"],"properties":{"label":{"type":"string"},"data":{"type":"array"},"type":{"type":"string"},"fill":{},"tension":{"type":"number"},"stepped":{},"borderDash":{"type":"array","items":{"type":"number"}},"backgroundColor":{},"borderColor":{},"borderWidth":{},"pointRadius":{},"pointStyle":{"type":"string"},"pointBackgroundColor":{},"pointBorderColor":{},"yAxisID":{"type":"string"},"xAxisID":{"type":"string"},"stack":{"type":"string"},"order":{"type":"number"},"hidden":{"type":"boolean"}}}}},"description":"Chart.js data. Required. Must include datasets (array of {label, data}). Optional labels."},"title":{"type":"string","description":"Chart title."},"subtitle":{"type":"string","description":"Chart subtitle."},"legend":{"type":"string","enum":["top","bottom","left","right","chartArea","false"],"default":"top","description":"Legend position, or false to hide."},"scales":{"type":"object","description":"Chart.js scales keyed by axis id (y, y2, x, …)."},"options":{"type":"object","description":"Raw Chart.js options. Merged on top of defaults."},"width":{"type":"number","description":"Output width in pixels, 50-4000."},"height":{"type":"number","description":"Output height in pixels, 50-4000."},"format":{"type":"string","enum":["png","svg"],"default":"png","description":"Use png so ChatGPT can display the image. svg is for download or infinite scale."},"background":{"type":"string","description":"Background color."},"device_pixel_ratio":{"type":"number","description":"Device pixel ratio, 0.5-4."},"version":{"type":"string","description":"Chart.js v4 version pin. Alias on GET: v."},"share":{"type":"boolean","enum":["false","true"],"default":"false","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}},"required":["type","data"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"},"examples":{"PNG image":{"value":"(binary image/png: use directly in <img src=\"...\"> or download)"},"SVG image (format: \"svg\")":{"value":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"800\" height=\"400\"> <!-- chart SVG --> </svg>"},"Shared chart (share: true)":{"value":{"id":"cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","view_url":"https://api.chartquery.com/v1/chart/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890","embed_url":"<iframe src=\"https://api.chartquery.com/v1/chart/view/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890\" frameborder=\"0\" width=\"800\" height=\"500\" style=\"border:none;\"></iframe>","expires_in":"3 days","render_url":"https://api.chartquery.com/v1/chart/render/cq-a1b2c3d4-e5f6-7890-abcd-ef1234567890"}}}}}},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}},"get":{"summary":"Chart","description":"Render a Chart.js image via GET. Pass the full chart object as URL-encoded JSON in query. Prefer format png for ChatGPT. POST sends the same object as a JSON body, not query.\n\n**Credit cost:** 5 credits per call","operationId":"get-chart","parameters":[{"name":"query","in":"query","required":true,"description":"Full chart config as URL-encoded JSON. Pass `?version=` or `?v=` separately to pin the chart version.\n\n**Bar chart** (copy & paste as ?query=):\n`{\"type\":\"bar\",\"title\":\"Monthly Sales\",\"legend\":\"bottom\",\"width\":1200,\"height\":600,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\"],\"datasets\":[{\"label\":\"2025\",\"data\":[42,58,37,65,49,72],\"backgroundColor\":\"rgba(99,102,241,0.85)\"},{\"label\":\"2026\",\"data\":[51,67,44,71,58,85],\"backgroundColor\":\"rgba(249,115,22,0.85)\"}]},\"scales\":{\"y\":{\"beginAtZero\":true}}}`\n\n**Line chart** (dual Y-axis):\n`{\"type\":\"line\",\"title\":\"Revenue vs Conversion\",\"legend\":\"top\",\"width\":1200,\"height\":600,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\"],\"datasets\":[{\"label\":\"Revenue (€)\",\"data\":[12000,18500,15200,21800,9300,17400],\"borderColor\":\"#6366f1\",\"tension\":0.4,\"fill\":false,\"yAxisID\":\"y\"},{\"label\":\"Conversion (%)\",\"data\":[3.2,4.1,2.8,5.0,1.9,3.7],\"borderColor\":\"#f97316\",\"tension\":0.4,\"fill\":false,\"yAxisID\":\"y2\"}]},\"scales\":{\"y\":{\"position\":\"left\"},\"y2\":{\"position\":\"right\",\"grid\":{\"display\":false}}}}`\n\n**Stacked area chart**:\n`{\"type\":\"area\",\"title\":\"API Usage by Brand\",\"legend\":\"top\",\"width\":1200,\"height\":600,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\"],\"datasets\":[{\"label\":\"CaptureKit\",\"data\":[12400,18900,14300,21500,9800,16200],\"borderColor\":\"#6366f1\",\"backgroundColor\":\"rgba(99,102,241,0.35)\",\"tension\":0.4,\"stack\":\"total\"},{\"label\":\"ChartQuery\",\"data\":[3200,6900,11500,8300,14700,9800],\"borderColor\":\"#22c55e\",\"backgroundColor\":\"rgba(34,197,94,0.35)\",\"tension\":0.4,\"stack\":\"total\"}]},\"scales\":{\"y\":{\"stacked\":true,\"beginAtZero\":true}}}`\n\n**Doughnut chart**:\n`{\"type\":\"doughnut\",\"title\":\"Traffic Sources\",\"legend\":\"right\",\"width\":800,\"height\":500,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Organic\",\"Paid\",\"Direct\",\"Referral\",\"Social\"],\"datasets\":[{\"data\":[38,24,18,12,8],\"backgroundColor\":[\"#6366f1\",\"#f97316\",\"#22c55e\",\"#ef4444\",\"#eab308\"],\"borderWidth\":2,\"borderColor\":\"#ffffff\"}]}}`\n\n**Radar chart**:\n`{\"type\":\"radar\",\"title\":\"Performance v1 vs v2\",\"legend\":\"top\",\"width\":800,\"height\":700,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Speed\",\"Reliability\",\"Security\",\"UX\",\"Scalability\"],\"datasets\":[{\"label\":\"v1\",\"data\":[65,70,80,60,75],\"borderColor\":\"#6366f1\",\"backgroundColor\":\"rgba(99,102,241,0.25)\"},{\"label\":\"v2\",\"data\":[88,92,90,85,95],\"borderColor\":\"#f97316\",\"backgroundColor\":\"rgba(249,115,22,0.25)\"}]}}`\n\n**SVG output** (add `\"format\":\"svg\"` to any example above for infinitely scalable output).","schema":{"type":"string","description":"Full chart config as URL-encoded JSON. Pass `?version=` or `?v=` separately to pin the chart version.\n\n**Bar chart** (copy & paste as ?query=):\n`{\"type\":\"bar\",\"title\":\"Monthly Sales\",\"legend\":\"bottom\",\"width\":1200,\"height\":600,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\"],\"datasets\":[{\"label\":\"2025\",\"data\":[42,58,37,65,49,72],\"backgroundColor\":\"rgba(99,102,241,0.85)\"},{\"label\":\"2026\",\"data\":[51,67,44,71,58,85],\"backgroundColor\":\"rgba(249,115,22,0.85)\"}]},\"scales\":{\"y\":{\"beginAtZero\":true}}}`\n\n**Line chart** (dual Y-axis):\n`{\"type\":\"line\",\"title\":\"Revenue vs Conversion\",\"legend\":\"top\",\"width\":1200,\"height\":600,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\"],\"datasets\":[{\"label\":\"Revenue (€)\",\"data\":[12000,18500,15200,21800,9300,17400],\"borderColor\":\"#6366f1\",\"tension\":0.4,\"fill\":false,\"yAxisID\":\"y\"},{\"label\":\"Conversion (%)\",\"data\":[3.2,4.1,2.8,5.0,1.9,3.7],\"borderColor\":\"#f97316\",\"tension\":0.4,\"fill\":false,\"yAxisID\":\"y2\"}]},\"scales\":{\"y\":{\"position\":\"left\"},\"y2\":{\"position\":\"right\",\"grid\":{\"display\":false}}}}`\n\n**Stacked area chart**:\n`{\"type\":\"area\",\"title\":\"API Usage by Brand\",\"legend\":\"top\",\"width\":1200,\"height\":600,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\"],\"datasets\":[{\"label\":\"CaptureKit\",\"data\":[12400,18900,14300,21500,9800,16200],\"borderColor\":\"#6366f1\",\"backgroundColor\":\"rgba(99,102,241,0.35)\",\"tension\":0.4,\"stack\":\"total\"},{\"label\":\"ChartQuery\",\"data\":[3200,6900,11500,8300,14700,9800],\"borderColor\":\"#22c55e\",\"backgroundColor\":\"rgba(34,197,94,0.35)\",\"tension\":0.4,\"stack\":\"total\"}]},\"scales\":{\"y\":{\"stacked\":true,\"beginAtZero\":true}}}`\n\n**Doughnut chart**:\n`{\"type\":\"doughnut\",\"title\":\"Traffic Sources\",\"legend\":\"right\",\"width\":800,\"height\":500,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Organic\",\"Paid\",\"Direct\",\"Referral\",\"Social\"],\"datasets\":[{\"data\":[38,24,18,12,8],\"backgroundColor\":[\"#6366f1\",\"#f97316\",\"#22c55e\",\"#ef4444\",\"#eab308\"],\"borderWidth\":2,\"borderColor\":\"#ffffff\"}]}}`\n\n**Radar chart**:\n`{\"type\":\"radar\",\"title\":\"Performance v1 vs v2\",\"legend\":\"top\",\"width\":800,\"height\":700,\"device_pixel_ratio\":1,\"data\":{\"labels\":[\"Speed\",\"Reliability\",\"Security\",\"UX\",\"Scalability\"],\"datasets\":[{\"label\":\"v1\",\"data\":[65,70,80,60,75],\"borderColor\":\"#6366f1\",\"backgroundColor\":\"rgba(99,102,241,0.25)\"},{\"label\":\"v2\",\"data\":[88,92,90,85,95],\"borderColor\":\"#f97316\",\"backgroundColor\":\"rgba(249,115,22,0.25)\"}]}}`\n\n**SVG output** (add `\"format\":\"svg\"` to any example above for infinitely scalable output)."}},{"name":"version","in":"query","required":false,"description":"Chart.js version to use. Alias: ?v=. Only v4.x is supported. Defaults to the installed version (4.5.1). Example: \"4\", \"4.5\", \"4.5.1\". The installed version is always returned in the X-ChartJS-Version response header.","schema":{"type":"string","default":"4.5.1","description":"Chart.js version to use. Alias: ?v=. Only v4.x is supported. Defaults to the installed version (4.5.1). Example: \"4\", \"4.5\", \"4.5.1\". The installed version is always returned in the X-ChartJS-Version response header."}},{"name":"share","in":"query","required":false,"description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image.","schema":{"type":"boolean","description":"If true, persist the result and return share URLs instead of an image. Leave false to get the image."}}],"responses":{"200":{"description":"Successful response"},"400":{"description":"Bad Request — missing or invalid parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Bad Request"}}}},"500":{"description":"Internal Server Error — something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Error"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message."}}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your API key. Include it in the x-api-key header for every request."}}}}