{"openapi":"3.1.0","info":{"title":"SVGMill API","version":"1.0.0","description":"Convert raster images (PNG, JPG and more) to SVG, PDF, EPS, DXF or PNG. One credit is one image traced; every export format of that trace is included. Errors look like {\"error\":{\"code\",\"message\"}}."},"servers":[{"url":"https://staging.svgmill.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"svgmill_live_… or svgmill_test_… API key"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"sm_session"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","invalid_request","insufficient_credits","rate_limited","account_frozen","decode","too_large","timeout","out_of_memory","busy","internal"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"LinkRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"return_to":{"type":"string","description":"Same-origin page to return to after the link (web app)."}},"required":["email"]},"LinkSent":{"type":"object","properties":{"status":{"type":"string","const":"sent"},"message":{"type":"string"}}},"Verified":{"type":"object","properties":{"email":{"type":"string"},"credits_granted":{"type":"integer"},"api_key":{"type":["string","null"]}}},"Key":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":"string","example":"svgmill_live_Ab12"},"label":{"type":"string"},"test":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"type":["string","null"],"format":"date-time"}}},"NewKey":{"allOf":[{"$ref":"#/components/schemas/Key"},{"type":"object","properties":{"key":{"type":"string","description":"The secret. Shown once."}},"required":["key"]}]},"Balance":{"type":"object","properties":{"total":{"type":"integer"},"plan":{"type":"integer"},"packs":{"type":"integer","description":"Pack, signup, admin and refund credits."},"overflow_available":{"type":"integer"}}},"Grant":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["signup","pack","plan","admin","refund"]},"amount":{"type":"integer"},"remaining":{"type":"integer"},"granted_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"frozen":{"type":"boolean"}}},"Subscription":{"type":"object","properties":{"plan":{"type":"string"},"status":{"type":"string","enum":["active","past_due","frozen","inactive","canceled"]},"credits_per_month":{"type":["integer","null"]},"period_end":{"type":["string","null"],"format":"date-time"},"cancel_at_period_end":{"type":"boolean"},"pending_plan":{"type":["string","null"]},"overflow_used":{"type":"integer"},"past_due_since":{"type":["string","null"],"format":"date-time"},"frozen_since":{"type":["string","null"],"format":"date-time"}}},"Account":{"type":"object","properties":{"email":{"type":"string"},"balance":{"$ref":"#/components/schemas/Balance"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/Grant"}},"subscription":{"oneOf":[{"$ref":"#/components/schemas/Subscription"},{"type":"null"}]},"usage_this_period":{"type":"integer"}}},"Conversions":{"type":"object","properties":{"conversions":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"input_name":{"type":"string"},"formats":{"type":"array","items":{"type":"string"}},"credits":{"type":"integer"},"status":{"type":"string","enum":["paid","preview","test","failed"]},"mode":{"type":"string"},"preset":{"type":"string"},"colors":{"type":["integer","null"]},"error_code":{"type":["string","null"]},"files_available":{"type":"boolean"},"files_expire_at":{"type":"string","format":"date-time"}}}},"next_cursor":{"type":["string","null"]}}},"Plans":{"type":"object","properties":{"currency":{"type":"string"},"packs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string"},"credits":{"type":"integer"},"price_cents":{"type":"integer"},"validity_months":{"type":"integer"}}}},"plans":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string"},"size":{"type":"string"},"interval":{"type":"string","enum":["monthly","annual"]},"credits_per_month":{"type":"integer"},"price_cents":{"type":"integer"},"price_per_month_cents":{"type":"integer"},"credit_expiry_days":{"type":"integer"},"overflow_credits":{"type":"integer"}}}}}},"Url":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"Purchase":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["pack","invoice"]},"item":{"type":"string"},"credits":{"type":"integer"},"amount_cents":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["paid","refunded","disputed"]},"invoice_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}}}},"paths":{"/v1/register":{"post":{"operationId":"postRegister","tags":["Account"],"summary":"Create an account","description":"Sends a verification link. A known email gets a sign-in link instead. Always 202, so the response does not reveal which emails exist. Disposable domains get 422.","security":[],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"202":{"description":"Link sent","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSent"}}}},"422":{"description":"Disposable email domain","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkRequest"}}}}}},"/v1/verify":{"get":{"operationId":"getVerify","tags":["Account"],"summary":"Open an email link","description":"Verifies the email, grants 5 signup credits on the first verification only, and starts a session. With a `return_to` from registration it redirects there (web app); otherwise it shows the first live API key once (JSON with `Accept: application/json`).","security":[],"parameters":[{"name":"token","in":"query","required":true,"description":"The token from the email link.","schema":{"type":"string"}}],"responses":{"200":{"description":"Key page (HTML) or JSON","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verified"}},"text/html":{"schema":{"type":"string","format":"binary"}}}},"302":{"description":"Redirect to return_to (web app)","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}}},"400":{"description":"Expired or used link","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/login":{"post":{"operationId":"postLogin","tags":["Account"],"summary":"Send a sign-in link","description":"Same flow as register. Existing accounts get no credits.","security":[],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"202":{"description":"Link sent","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSent"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkRequest"}}}}}},"/v1/logout":{"post":{"operationId":"postLogout","tags":["Account"],"summary":"End the browser session","security":[{"cookieAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Signed out","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys":{"get":{"operationId":"getKeys","tags":["Keys"],"summary":"List API keys","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Active keys","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/Key"}}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postKeys","tags":["Keys"],"summary":"Create an API key","description":"The secret is returned once and stored only as a SHA-256 hash.","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"The new key, with its secret","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewKey"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","maxLength":64},"test":{"type":"boolean","default":false}}}}}}}},"/v1/keys/{id}":{"delete":{"operationId":"deleteKeys/Id","tags":["Keys"],"summary":"Revoke an API key","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"revoked":{"type":"boolean"}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"Balance, grants, plan and usage","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Account","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteAccount","tags":["Account"],"summary":"Delete the account","description":"Deletes the user, keys, sessions and stored files, and cancels any plan. Ledger rows are anonymised.","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Deleted","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vectorize":{"post":{"operationId":"postVectorize","tags":["Vectorize"],"summary":"Convert an image to a vector","description":"`production` (default) costs 1 credit and returns the file. `preview` is free, works anonymously and returns a watermarked PNG whose token can be downloaded later for 1 credit. `test` is free, needs a test key and returns a watermarked result. A failed trace is never charged. Send a JSON `token` to re-trace an earlier image with new options (1 credit).","security":[{},{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"The vector file (or the preview PNG). See X-Image-Token, X-Credits-Charged, X-Credits-Remaining.","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."},"X-Image-Token":{"schema":{"type":"string"},"description":"Token for later downloads and re-traces."},"X-Credits-Charged":{"schema":{"type":"integer"}},"X-Credits-Remaining":{"schema":{"type":"integer"}}},"content":{"image/svg+xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/postscript":{"schema":{"type":"string","format":"binary"}},"image/vnd.dxf":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}}}},"402":{"description":"No credits","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Frozen plan and no pack credits, or test mode without a test key","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Not a readable image, or too large","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri"},"image_base64":{"type":"string","description":"Raw base64 or a data: URL."},"token":{"type":"string","description":"Re-trace an earlier image."},"mode":{"type":"string","enum":["production","preview","test"],"default":"production"},"preset":{"type":"string","enum":["logo","bw"],"default":"logo"},"colors":{"type":"integer","minimum":2,"maximum":64},"format":{"type":"string","enum":["svg","pdf","eps","dxf","png"],"default":"svg"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"image":{"type":"string","format":"binary"},"mode":{"type":"string","enum":["production","preview","test"],"default":"production"},"preset":{"type":"string","enum":["logo","bw"],"default":"logo"},"colors":{"type":"integer","minimum":2,"maximum":64},"format":{"type":"string","enum":["svg","pdf","eps","dxf","png"],"default":"svg"}},"required":["image"]}}}}}},"/v1/download":{"post":{"operationId":"postDownload","tags":["Vectorize"],"summary":"Download a format of an earlier trace","description":"The first paid download of a preview token costs 1 credit. Every other format, and any later download of a paid token, is free.","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"The file","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."},"X-Image-Token":{"schema":{"type":"string"},"description":"Token for later downloads and re-traces."},"X-Credits-Charged":{"schema":{"type":"integer"}},"X-Credits-Remaining":{"schema":{"type":"integer"}}},"content":{"image/svg+xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/postscript":{"schema":{"type":"string","format":"binary"}},"image/vnd.dxf":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"No credits","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown or expired token","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"format":{"type":"string","enum":["svg","pdf","eps","dxf","png"],"default":"svg"}},"required":["token"]}}}}}},"/v1/conversions":{"get":{"operationId":"getConversions","tags":["Vectorize"],"summary":"Conversion history","description":"Newest first. Files are removed after 30 days; rows stay.","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"`next_cursor` from the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of conversions","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversions"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/plans":{"get":{"operationId":"getPlans","tags":["Billing"],"summary":"Packs and plans","security":[],"responses":{"200":{"description":"The catalogue","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plans"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/checkout":{"post":{"operationId":"postCheckout","tags":["Billing"],"summary":"Start a Stripe Checkout","description":"Packs use a one-off payment, plans a subscription. Tax is calculated by Stripe.","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Checkout URL","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Url"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already on a plan (use /v1/subscription)","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"item":{"type":"string","example":"pack_100"}},"required":["item"]}}}}}},"/v1/purchases":{"get":{"operationId":"getPurchases","tags":["Billing"],"summary":"Packs bought and invoices paid","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Purchases","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"purchases":{"type":"array","items":{"$ref":"#/components/schemas/Purchase"}}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/subscription":{"get":{"operationId":"getSubscription","tags":["Billing"],"summary":"Current plan","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Plan or null","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"subscription":{"oneOf":[{"$ref":"#/components/schemas/Subscription"},{"type":"null"}]}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postSubscription","tags":["Billing"],"summary":"Cancel, resume, change or reactivate the plan","description":"`cancel` takes effect at the period end. `change {item}`: upgrades are immediate, billed pro rata, and the extra credits for the rest of this month are granted now; downgrades take effect at the period end. `reactivate` works only from `inactive`: it pays the outstanding invoice first, then returns a Checkout URL for a new subscription.","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Updated plan, or a URL to continue","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Upgrade payment failed","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["cancel","resume","change","reactivate"]},"item":{"type":"string"}},"required":["action"]}}}}}},"/v1/billing-portal":{"post":{"operationId":"postBillingPortal","tags":["Billing"],"summary":"Stripe Customer Portal link","security":[{"bearerAuth":[]},{"cookieAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays within 24 h return the stored response. Works for JSON and multipart bodies alike: a multipart retry matches on its fields and file contents, not its boundary.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Portal URL","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Url"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/stripe/webhook":{"post":{"operationId":"postStripeWebhook","tags":["Billing"],"summary":"Stripe events","description":"Signed by Stripe (HMAC-SHA256, 5-minute tolerance) and deduplicated by event id. Not for API clients.","security":[],"parameters":[{"name":"Stripe-Signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Received","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad signature","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed in the window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in the window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix time (seconds) when the window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}}}}