{"openapi":"3.1.0","info":{"title":"Inspyry vector API","version":"0.1.0","description":"Turn a text prompt into a clean, flat-colour SVG. Anonymous use gets a small free daily allowance; credits (Bearer API key) include the commercial licence. Failed or filtered generations are never charged."},"servers":[{"url":"https://inspyry.com"}],"paths":{"/v1/vectors":{"post":{"operationId":"generateVector","summary":"Generate an SVG","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorResponse"}}}},"400":{"description":"invalid_request: a control value or the prompt is invalid. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"payment_required: no credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"turnstile_failed: bot check failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"quality_failed or blocked_prompt. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited: free allowance used up for now","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"generation_failed: temporary provider problem. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"capacity_reached or misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vectors/{id}/svg":{"get":{"operationId":"getVectorSvg","summary":"Download a generated SVG by id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The SVG file","content":{"image/svg+xml":{"schema":{"type":"string"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/balance":{"get":{"operationId":"getBalance","summary":"Credits and free generations left","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"enum":["device","api_key"]},"credits":{"type":"integer"},"free_left":{"type":"integer"},"free_limit":{"type":"integer"}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/prices":{"get":{"operationId":"getPrices","summary":"The credit pack price the caller's country gets at checkout, before tax (dollars when unknown)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pack_100":{"type":"object","properties":{"credits":{"type":"integer"},"amount":{"type":"integer","description":"Minor units, e.g. cents"},"currency":{"type":"string","description":"ISO 4217 code"},"country":{"type":["string","null"]}}}}}}}}}}},"/v1/events":{"post":{"operationId":"recordEvents","summary":"Record anonymous funnel events (visit, generate, download, ...)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","maxItems":20,"items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"props":{"type":"object"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"stored":{"type":"integer"}}}}}},"400":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/checkout":{"post":{"operationId":"createCheckout","summary":"Start a credit-pack checkout","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"pack":{"type":"string","default":"pack_100"},"email":{"type":"string","format":"email"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri"}}}}}},"400":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"billing_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"billing_unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"get":{"operationId":"getAccount","summary":"Who am I and how many credits do I have","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"signed_in":{"type":"boolean"},"email":{"type":"string"},"credits":{"type":"integer"},"has_api_key":{"type":"boolean"}}}}}}}}},"/v1/account/key":{"post":{"operationId":"rotateApiKey","summary":"Create a new API key (shown once) and revoke the old one","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string"},"prefix":{"type":"string"}}}}}},"401":{"description":"sign_in_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/magic":{"post":{"operationId":"requestSignInLink","summary":"Email a one-time sign-in link (always answers sent: true)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean"}}}}}},"400":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/verify":{"post":{"operationId":"verifySignInLink","summary":"Use a sign-in link token to attach this device to the account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"linked":{"type":"boolean"},"email":{"type":"string"}}}}}},"400":{"description":"invalid_token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"operationId":"mcp","summary":"Model Context Protocol endpoint (streamable HTTP, JSON-RPC 2.0): tools generate_vector and get_balance","responses":{"200":{"description":"JSON-RPC response"},"202":{"description":"Notification accepted"}}},"get":{"operationId":"mcpGet","summary":"Not supported: there is no server-initiated stream","responses":{"405":{"description":"method_not_allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key (ik_...). Optional: anonymous use is limited to a few generations per day."}},"schemas":{"Error":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"}}},"VectorRequest":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","maxLength":400,"description":"What to draw, e.g. \"a sitting fox\"."},"style":{"type":"string","enum":["flat-sticker","stencil","line-art","graffiti","tattoo","comic","manga","cartoon","esports-mascot","retro","art-deco","art-nouveau","vaporwave","cyberpunk","woodcut","engraving","stained-glass","papercut","halftone","doodle","ukiyoe","folk-art","tribal","celtic","filigree","pixel","low-poly","isometric","minimal-icon","monoline","geometric","kawaii","nautical","western","tiki"],"default":"flat-sticker"},"shape":{"type":"string","enum":["free","circle","rounded-square","shield","die-cut","wreath","hexagon","cameo","banner","speech-bubble","mandala"]},"composition":{"type":"string","enum":["single","set","pattern","border"]},"lineWeight":{"type":"string","enum":["thin","medium","bold"]},"shading":{"type":"string","enum":["flat","cel","hatch","halftone"]},"view":{"type":"string","enum":["front","side","three-quarter"]},"mood":{"type":"string","enum":["playful","serious","elegant","aggressive"]},"avoid":{"type":"string","maxLength":200},"colours":{"type":"integer","minimum":1,"maximum":16,"description":"1 produces a single-colour stencil."},"detail":{"type":"string","enum":["low","medium","high"],"default":"medium"},"background":{"type":"object","description":"{\"kind\":\"transparent\"} (default) or {\"kind\":\"solid\",\"colour\":\"#rrggbb\"}"},"palette":{"oneOf":[{"type":"string","enum":["pastel","neon","earthy","duotone","retro-cmyk","monochrome","sunset","ocean"]},{"type":"array","items":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}}]},"outline":{"type":"object","description":"{\"colour\":\"#rrggbb\",\"width\":number} for outline-only artwork"},"aspect":{"type":"number","minimum":0.1,"maximum":10},"margin":{"type":"number","minimum":0,"maximum":0.5},"flip":{"type":"string","enum":["horizontal","vertical"]}}},"VectorResponse":{"type":"object","properties":{"id":{"type":"string"},"svg":{"type":"string"},"svg_url":{"type":"string","format":"uri"},"prompt":{"type":"string","description":"The enhanced prompt that was sent to the model."},"attempts":{"type":"integer"},"credits_used":{"type":"integer"},"credits_left":{"type":"integer"},"free_left":{"type":"integer"},"license":{"enum":["personal","commercial"]},"warnings":{"type":"array","items":{"type":"string"}}}}}},"security":[{},{"bearer":[]}]}