{"openapi":"3.1.0","info":{"title":"Foundily Equity API","version":"1.0.0","description":"Deterministic startup-equity math: convert SAFEs, model priced rounds, compute dilution, and run exit waterfalls. Single-key auth, structured errors, idempotency keys, usage-metered.","contact":{"name":"Foundily","url":"https://foundily.com"}},"servers":[{"url":"https://foundily.com/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"Send your key as `Authorization: Bearer fd_live_...`"}},"schemas":{"Safe":{"type":"object","required":["investment"],"properties":{"name":{"type":"string"},"investment":{"type":"number","description":"Amount in USD"},"valuationCap":{"type":"number","description":"Valuation cap (post- or pre-money)"},"discount":{"type":"number","description":"Discount as a fraction, e.g. 0.2 for 20%"},"type":{"type":"string","enum":["post","pre"],"default":"post"},"interestRate":{"type":"number","description":"Convertible-note simple interest (fraction)"},"interestYears":{"type":"number"}}},"PricedRound":{"type":"object","required":["preMoney","investment"],"properties":{"name":{"type":"string"},"preMoney":{"type":"number","description":"Amount in USD"},"investment":{"type":"number","description":"Amount in USD"},"targetOptionPool":{"type":"number","description":"Target post-round option-pool % (0..0.9)"},"liquidationMultiple":{"type":"number","default":1},"participating":{"type":"boolean","default":false},"participationCap":{"type":"number"}}},"Holder":{"type":"object","required":["name","shares"],"properties":{"name":{"type":"string"},"shares":{"type":"number"},"security":{"type":"string","enum":["common","preferred","option","safe","note"]}}}}},"paths":{"/safe/convert":{"post":{"operationId":"convertSafe","summary":"Convert a single SAFE at a priced round","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["safe","round"],"properties":{"safe":{"$ref":"#/components/schemas/Safe"},"round":{"$ref":"#/components/schemas/PricedRound"},"preRoundFullyDilutedShares":{"type":"number","default":10000000},"existingPoolShares":{"type":"number"}}}}}},"responses":{"200":{"description":"Conversion result (shares, ownership, price)"}}}},"/rounds/model":{"post":{"operationId":"modelRound","summary":"Model a priced round with SAFE conversion + option pool","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["founders","round"],"properties":{"founders":{"type":"array","items":{"$ref":"#/components/schemas/Holder"}},"optionPoolShares":{"type":"number","default":0},"safes":{"type":"array","items":{"$ref":"#/components/schemas/Safe"}},"round":{"$ref":"#/components/schemas/PricedRound"}}}}}},"responses":{"200":{"description":"Post-round cap table"}}}},"/dilution":{"post":{"operationId":"computeDilution","summary":"Run a multi-round dilution scenario","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["founders","events"],"properties":{"founders":{"type":"array","items":{"$ref":"#/components/schemas/Holder"}},"optionPoolShares":{"type":"number","default":0},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"const":"safe"},"safe":{"$ref":"#/components/schemas/Safe"}}},{"type":"object","properties":{"kind":{"const":"round"},"round":{"$ref":"#/components/schemas/PricedRound"}}}]}}}}}}},"responses":{"200":{"description":"Per-stage cap tables + founder ownership trail"}}}},"/waterfall":{"post":{"operationId":"exitWaterfall","summary":"Compute an exit / liquidation waterfall","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["exitValue","commonShares","series"],"properties":{"exitValue":{"type":"number","description":"Amount in USD"},"commonShares":{"type":"number"},"optionShares":{"type":"number"},"series":{"type":"array","items":{"type":"object","required":["name","invested","shares"],"properties":{"name":{"type":"string"},"invested":{"type":"number","description":"Amount in USD"},"shares":{"type":"number"},"liquidationMultiple":{"type":"number","default":1},"participating":{"type":"boolean"},"participationCap":{"type":"number"},"seniority":{"type":"number","default":1}}}}}}}}},"responses":{"200":{"description":"Per-stakeholder proceeds + return multiples"}}}}}}