{"openapi":"3.1.0","info":{"title":"vizzy","version":"1.0.0","summary":"A chart you can paste.","description":"A chart you can paste. Ask a public question. Get the picture, the source, and a short explanation. Emit ChartConfig v1. Do not invent D3. Three free charts a day, then $8 for 25."},"servers":[{"url":"https://vizzy.run"}],"tags":[{"name":"compose","description":"Prompt in, paste URL and PNG out."},{"name":"publish","description":"Rows plus ChartConfig in, paste URL and PNG out."},{"name":"quota","description":"What this wallet or IP can still generate today."}],"security":[{"bearerAuth":[]},{}],"paths":{"/api/compose":{"get":{"tags":["compose"],"summary":"Describe POST /api/compose","operationId":"describeCompose","responses":{"200":{"description":"How to POST a prompt.","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["compose"],"summary":"Generate a chart from a prompt","operationId":"composeChart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","examples":["ARR by quarter, last two years"]},"disposition":{"type":"string","enum":["ask","send"],"description":"ask is the default. send mints this prompt and does not ask."},"seed":{"type":"object","description":"Optional chart seed from a paste page."}}}}}},"responses":{"200":{"description":"Minted paste URL and PNG, or a clarify question and options. HTML clients are redirected for a minted chart.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["ok","url","png","token"],"properties":{"ok":{"const":true},"url":{"type":"string","format":"uri"},"png":{"type":"string","format":"uri"},"token":{"type":"string"}}},{"type":"object","required":["clarify"],"properties":{"clarify":{"type":"object","required":["question","options"],"properties":{"question":{"type":"string"},"options":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","required":["label","prompt"],"properties":{"label":{"type":"string"},"prompt":{"type":"string"}}}}}}}}]}}}},"400":{"description":"Prompt or compiled config failed.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"pay":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["path","code","message"],"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"suggestion":{"type":"string"}}}},"packCredits":{"type":"integer"},"packPriceLabel":{"type":"string"}}}}}},"402":{"description":"Free meter spent. Pay, then retry with the wallet cookie or Bearer token.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"pay":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["path","code","message"],"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"suggestion":{"type":"string"}}}},"packCredits":{"type":"integer"},"packPriceLabel":{"type":"string"}}}}}}}}},"/api/publish":{"get":{"tags":["publish"],"summary":"Describe POST /api/publish","operationId":"describePublish","responses":{"200":{"description":"How to POST rows.","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["publish"],"summary":"Mint a chart from rows","operationId":"publishChart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","data"],"properties":{"title":{"type":"string"},"data":{"type":"array","minItems":1,"items":{"type":"object"}},"config":{"type":"object","description":"ChartConfig v1. Inferred from rows if omitted."},"source":{"type":"object"},"kicker":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"Minted paste URL and PNG.","content":{"application/json":{"schema":{"type":"object","required":["ok","url","png","token"],"properties":{"ok":{"const":true},"url":{"type":"string","format":"uri"},"png":{"type":"string","format":"uri"},"token":{"type":"string"}}}}}},"400":{"description":"title, rows, or config failed. issues[] names the field.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"pay":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["path","code","message"],"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"suggestion":{"type":"string"}}}},"packCredits":{"type":"integer"},"packPriceLabel":{"type":"string"}}}}}},"402":{"description":"Free meter spent. Same wallet as compose.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"pay":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["path","code","message"],"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"suggestion":{"type":"string"}}}},"packCredits":{"type":"integer"},"packPriceLabel":{"type":"string"}}}}}}}}},"/api/quota":{"get":{"tags":["quota"],"summary":"Peek remaining free charts and paid credits","operationId":"getQuota","responses":{"200":{"description":"Current meter for this cookie, Bearer token, or IP.","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"canCompose":{"type":"boolean"},"freeLeft":{"type":"integer"},"credits":{"type":"integer"},"unlimited":{"type":"boolean"},"pay":{"type":"boolean"}}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Optional wallet token. Same value as the vizzy_wallet cookie, optionally prefixed with vizzy_. After three free charts a day, compose and publish need this or the cookie."}},"schemas":{"ValidationIssue":{"type":"object","additionalProperties":false,"required":["path","code","message"],"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"suggestion":{"type":"string"}}},"Fail":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"pay":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["path","code","message"],"properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"suggestion":{"type":"string"}}}},"packCredits":{"type":"integer"},"packPriceLabel":{"type":"string"}}},"Minted":{"type":"object","required":["ok","url","png","token"],"properties":{"ok":{"const":true},"url":{"type":"string","format":"uri"},"png":{"type":"string","format":"uri"},"token":{"type":"string"}}}}}}