{"openapi":"3.1.0","info":{"title":"Golden Ratio & Scale API","version":"1.0.0","description":"Design-proportion maths as an API, computed locally and deterministically. The divide endpoint splits a length by the golden section, the division beloved of artists and designers in which the whole is to the longer part as the longer is to the shorter, both ratios equal to φ = (1+√5)/2 ≈ 1.618 — so 100 splits into a 61.8 longer segment and a 38.2 shorter one — and can also extend a single segment to its larger or smaller golden partner. The rectangle endpoint gives the other side and the area of a golden rectangle from either side, the shape that leaves a smaller golden rectangle when you remove a square. The scale endpoint builds a modular (typographic) scale — base · ratio^step across a range of steps up and down — for harmonious type sizes and spacing, taking a numeric ratio or a named musical one such as minor-third (1.2), major-third (1.25), perfect-fourth (1.333) or golden (φ); a 16-base major-third scale gives 16, 20, 25, 31.25 and so on. Lengths are unit-agnostic. Everything is computed locally and deterministically, so it is instant and private. Ideal for graphic-design, web-design, UI, typography, layout and architecture app developers, type-scale and proportion tools, and design systems. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is proportion and scale; for pixel-density and print sizing use a PPI/DPI API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/goldenratio-api","description":"oanor gateway"}],"tags":[{"name":"GoldenRatio"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/divide":{"get":{"operationId":"get_v1_divide","tags":["GoldenRatio"],"summary":"Golden section of a length","description":"","parameters":[{"name":"length","in":"query","required":false,"description":"Length to split","schema":{"type":"string"},"example":"100"},{"name":"part","in":"query","required":false,"description":"Or a segment to extend","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Golden section: a length is split so whole/longer = longer/shorter = φ. longer ≈ 0.618·whole, shorter ≈ 0.382·whole.","ratio":1.61803399,"inputs":{"length":100},"longer_segment":61.803399,"shorter_segment":38.196601},"meta":{"timestamp":"2026-06-05T19:50:18.726Z","request_id":"57a6173a-4e8c-4715-b189-ac2dae66bc49"},"status":"ok","message":"Golden section","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/rectangle":{"get":{"operationId":"get_v1_rectangle","tags":["GoldenRatio"],"summary":"Golden rectangle","description":"","parameters":[{"name":"short_side","in":"query","required":false,"description":"Short side","schema":{"type":"string"},"example":"100"},{"name":"long_side","in":"query","required":false,"description":"Or long side","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"area":16180.339887,"note":"Golden rectangle: long side = short · φ. Removing a square leaves a smaller golden rectangle.","inputs":{"short_side":100},"long_side":161.803399},"meta":{"timestamp":"2026-06-05T19:50:18.828Z","request_id":"a02f991c-6a65-4bad-8c36-549d4ef88c21"},"status":"ok","message":"Golden rectangle","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/scale":{"get":{"operationId":"get_v1_scale","tags":["GoldenRatio"],"summary":"Modular type scale","description":"","parameters":[{"name":"base","in":"query","required":true,"description":"Base value (e.g. font size)","schema":{"type":"string"},"example":"16"},{"name":"ratio","in":"query","required":false,"description":"Numeric ratio","schema":{"type":"string"}},{"name":"ratio_name","in":"query","required":false,"description":"minor-third, major-third, perfect-fourth, golden…","schema":{"type":"string"},"example":"major-third"},{"name":"steps_up","in":"query","required":false,"description":"Steps up (default 5)","schema":{"type":"string"},"example":"5"},{"name":"steps_down","in":"query","required":false,"description":"Steps down (default 2)","schema":{"type":"string"},"example":"2"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Modular scale value = base · ratio^step. Used for typographic and spacing scales; common ratios include major-third (1.25), perfect-fourth (1.333) and golden (φ≈1.618).","steps":[{"step":-2,"value":10.24},{"step":-1,"value":12.8},{"step":0,"value":16},{"step":1,"value":20},{"step":2,"value":25},{"step":3,"value":31.25},{"step":4,"value":39.0625},{"step":5,"value":48.828125}],"inputs":{"base":16,"ratio":1.25,"ratio_name":"major-third"}},"meta":{"timestamp":"2026-06-05T19:50:18.952Z","request_id":"f401e94e-5850-4e68-84ba-8ea1fac7c8fd"},"status":"ok","message":"Modular scale","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"phi":1.61803398875,"notes":"φ = (1+√5)/2 ≈ 1.618. Lengths are unit-agnostic. The scale takes a numeric ratio or a named one (major-third, perfect-fourth, golden…).","ratios":["minor-second","major-second","minor-third","major-third","perfect-fourth","augmented-fourth","perfect-fifth","golden","phi"],"service":"goldenratio-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/scale":"Modular (typographic) scale from a base, ratio and step range.","GET /v1/divide":"Split a length by the golden section, or extend a segment.","GET /v1/rectangle":"Golden rectangle's other side and area."},"description":"Design proportions: golden section, golden rectangle, and the modular/typographic scale."},"meta":{"timestamp":"2026-06-05T19:50:19.055Z","request_id":"30138ad4-bcc3-4145-8f10-be00c3159d6e"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":6400,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":495,"monthly_call_quota":64000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1370,"monthly_call_quota":295000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4350,"monthly_call_quota":1560000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/goldenratio-api"}