{"openapi":"3.1.0","info":{"title":"Modular Scale API","version":"1.0.0","description":"Generate a modular (geometric) scale for typography and spacing. Pick a base size and a ratio — a named musical interval (minor-second, major-second, minor-third, major-third, perfect-fourth, augmented-fourth, perfect-fifth, minor-sixth, golden, major-sixth, minor-seventh, major-seventh, octave and more), a plain number like 1.25, or an interval written as 3:2 — and the scale endpoint returns a harmonious set of sizes stepping up and down from the base, where each value is base × ratio^step (step 0 is the base). Choose how many steps above and below, the rounding, and an optional unit suffix (px, rem, em) so the values come back ready to paste into CSS or design tokens. The ratios endpoint lists every named ratio with its decimal value. A modular scale gives type, spacing and layout a consistent rhythm instead of arbitrary pixel values. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This produces a numeric size scale; for colour scales and gradients use the Gradient API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/modularscale-api","description":"oanor gateway"}],"tags":[{"name":"Scale"},{"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/ratios":{"get":{"operationId":"get_v1_ratios","tags":["Scale"],"summary":"List named ratios","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":17,"usage":"Pass ?ratio=<name|number|a:b>&base=<n>&up=<n>&down=<n> to /v1/scale.","ratios":[{"name":"minor-second","value":1.06667},{"name":"major-second","value":1.125},{"name":"minor-third","value":1.2},{"name":"major-third","value":1.25},{"name":"perfect-fourth","value":1.33333},{"name":"augmented-fourth","value":1.41421},{"name":"perfect-fifth","value":1.5},{"name":"minor-sixth","value":1.6},{"name":"golden","value":1.61803},{"name":"major-sixth","value":1.66667},{"name":"minor-seventh","value":1.77778},{"name":"major-seventh","value":1.875},{"name":"octave","value":2},{"name":"major-tenth","value":2.5},{"name":"major-eleventh","value":2.66667},{"name":"major-twelfth","value":3},{"name":"double-octave","value":4}],"aliases":[{"alias":"phi","ratio":"golden"},{"alias":"golden-ratio","ratio":"golden"},{"alias":"tritone","ratio":"augmented-fourth"}]},"meta":{"timestamp":"2026-06-03T09:25:05.200Z","request_id":"18c8f906-f7c5-444e-ae57-7fad8c602a5e"},"status":"ok","message":"List named ratios","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":["Scale"],"summary":"Generate a modular scale","description":"","parameters":[{"name":"base","in":"query","required":false,"description":"The base size (default 16)","schema":{"type":"string"},"example":"16"},{"name":"ratio","in":"query","required":false,"description":"Named ratio, number, or a:b interval (default golden)","schema":{"type":"string"},"example":"major-third"},{"name":"up","in":"query","required":false,"description":"Steps above the base (default 6)","schema":{"type":"string"},"example":"6"},{"name":"down","in":"query","required":false,"description":"Steps below the base (default 2)","schema":{"type":"string"},"example":"2"},{"name":"round","in":"query","required":false,"description":"Decimal places (default 4)","schema":{"type":"string"}},{"name":"unit","in":"query","required":false,"description":"Optional suffix like px or rem","schema":{"type":"string"},"example":"px"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"up":6,"base":16,"down":2,"unit":"px","count":9,"ratio":"major-third","steps":[{"step":-2,"value":10.24,"formatted":"10.24px"},{"step":-1,"value":12.8,"formatted":"12.8px"},{"step":0,"value":16,"formatted":"16px"},{"step":1,"value":20,"formatted":"20px"},{"step":2,"value":25,"formatted":"25px"},{"step":3,"value":31.25,"formatted":"31.25px"},{"step":4,"value":39.0625,"formatted":"39.0625px"},{"step":5,"value":48.8281,"formatted":"48.8281px"},{"step":6,"value":61.0352,"formatted":"61.0352px"}],"ratio_value":1.25},"meta":{"timestamp":"2026-06-03T09:25:05.302Z","request_id":"819243ca-56c2-4819-aa35-ab0c96247a9a"},"status":"ok","message":"Generate a 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":{"name":"Modular Scale API","notes":"Each value is base × ratio^step, with step 0 = the base. Ideal for type scales, spacing systems and design tokens. This produces a numeric scale — to convert or build colour scales use the colour and gradient APIs. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/scale","params":{"up":"steps above the base (default 6)","base":"the base size (default 16)","down":"steps below the base (default 2)","unit":"optional suffix like px or rem","ratio":"named ratio, number, or a:b interval (default golden)","round":"decimal places (default 4)"},"returns":"the scale as an array of {step, value, formatted}"},{"path":"/v1/ratios","params":[],"returns":"all named ratios with their decimal values"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Generate a modular (geometric) scale for typography and spacing. Pick a base value and a ratio — a named musical interval (minor-third, major-third, perfect-fourth, perfect-fifth, golden, octave…), a plain number like 1.25, or an interval like 3:2 — and get a harmonious scale of sizes stepping up and down from the base, each value being base × ratio^step. Choose how many steps above and below, the rounding, and an optional unit suffix (px, rem, em). The ratios endpoint lists every named ratio with its decimal value. Pure local maths, no key."},"meta":{"timestamp":"2026-06-03T09:25:05.398Z","request_id":"753db686-143a-4ec4-858c-dc659ac6c703"},"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":2035,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":355,"monthly_call_quota":11550,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2345,"monthly_call_quota":166500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6145,"monthly_call_quota":875000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/modularscale-api"}