{"openapi":"3.1.0","info":{"title":"Gear Ratio API","version":"1.0.0","description":"Gear-train ratio, speed and torque maths as an API, computed locally and deterministically. The ratio endpoint computes the gear ratio of a single pair from the driver and driven tooth counts (or pitch diameters), ratio = N_driven/N_driver, classifies it as a reduction (more torque, less speed) or an overdrive, and — given an input speed and torque — returns the output speed (input/ratio) and the output torque (input·ratio·efficiency). The train endpoint computes a compound gear train: the overall ratio is the product of the individual stage ratios, and it returns each stage ratio, the output speed and torque, noting that idler gears change only the direction of rotation, not the ratio. The solve endpoint finds the missing one of the input speed, the output speed and the ratio from the other two — for example, the ratio needed to drop a 1500 rpm motor to a 500 rpm output. Everything is computed locally and deterministically, so it is instant and private. Ideal for drivetrain, robotics and machine-design tools, gearbox and transmission selection, bicycle and vehicle gearing, and mechanical-engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is gear-train ratio and torque; for spur-gear tooth geometry use a spur-gear API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/gearratio-api","description":"oanor gateway"}],"tags":[{"name":"Gear"},{"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/ratio":{"get":{"operationId":"get_v1_ratio","tags":["Gear"],"summary":"Single-pair gear ratio","description":"","parameters":[{"name":"driver_teeth","in":"query","required":false,"description":"Driver gear teeth","schema":{"type":"string"},"example":"20"},{"name":"driven_teeth","in":"query","required":false,"description":"Driven gear teeth","schema":{"type":"string"},"example":"60"},{"name":"driver_diameter","in":"query","required":false,"description":"Or driver pitch diameter","schema":{"type":"string"}},{"name":"driven_diameter","in":"query","required":false,"description":"and driven pitch diameter","schema":{"type":"string"}},{"name":"input_speed","in":"query","required":false,"description":"Input speed (rpm)","schema":{"type":"string"},"example":"1500"},{"name":"input_torque","in":"query","required":false,"description":"Input torque","schema":{"type":"string"},"example":"10"},{"name":"efficiency","in":"query","required":false,"description":"Efficiency (0–1, default 1)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"ratio = driven/driver. Output speed = input/ratio; output torque = input·ratio·efficiency.","type":"reduction (torque up, speed down)","inputs":{"driven_teeth":60,"driver_teeth":20},"gear_ratio":3,"output_torque":30,"output_speed_rpm":500},"meta":{"timestamp":"2026-06-04T18:38:22.477Z","request_id":"0cdb3c8b-2dd4-4253-abe2-d84f91e14b4d"},"status":"ok","message":"Gear ratio","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/solve":{"get":{"operationId":"get_v1_solve","tags":["Gear"],"summary":"Solve speed / ratio","description":"","parameters":[{"name":"input_speed","in":"query","required":false,"description":"Input speed (rpm)","schema":{"type":"string"},"example":"1500"},{"name":"output_speed","in":"query","required":false,"description":"Output speed (rpm)","schema":{"type":"string"},"example":"500"},{"name":"ratio","in":"query","required":false,"description":"Gear ratio","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mode":"solve_ratio","note":"ratio = input_speed/output_speed.","ratio":3,"inputs":{"input_speed":1500,"output_speed":500}},"meta":{"timestamp":"2026-06-04T18:38:22.583Z","request_id":"8724696a-76ac-4709-94ad-b8c406398a3d"},"status":"ok","message":"Solve speed/ratio","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/train":{"get":{"operationId":"get_v1_train","tags":["Gear"],"summary":"Compound train ratio","description":"","parameters":[{"name":"stages","in":"query","required":true,"description":"JSON array of {driver, driven}","schema":{"type":"string"},"example":"[{\"driver\":20,\"driven\":60},{\"driver\":15,\"driven\":45}]"},{"name":"input_speed","in":"query","required":false,"description":"Input speed (rpm)","schema":{"type":"string"},"example":"1800"},{"name":"input_torque","in":"query","required":false,"description":"Input torque","schema":{"type":"string"},"example":"5"},{"name":"efficiency","in":"query","required":false,"description":"Per-stage efficiency (0–1, default 1)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Overall ratio = product of stage (driven/driver) ratios. Idler gears change direction only, not the ratio.","type":"reduction","stages":[{"ratio":3,"stage":1,"driven":60,"driver":20},{"ratio":3,"stage":2,"driven":45,"driver":15}],"stage_count":2,"output_torque":45,"overall_ratio":9,"output_speed_rpm":200},"meta":{"timestamp":"2026-06-04T18:38:22.665Z","request_id":"6093e877-6f63-4386-bb24-d2089ed66acf"},"status":"ok","message":"Compound train","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":{"notes":"Teeth counts or diameters are unitless ratios; speed in rpm, torque in any consistent unit. A ratio > 1 is a reduction (more torque, less speed). Idler gears only reverse direction.","service":"gearratio-api","formulae":{"ratio":"ratio = N_driven/N_driver","speed":"output = input/ratio","train":"overall = Π(driven_i/driver_i)","torque":"output = input·ratio·efficiency"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/ratio":"Gear ratio (from teeth or diameters) with output speed and torque.","GET /v1/solve":"Solve the missing one of input speed, output speed and ratio.","GET /v1/train":"Compound-train overall ratio from a list of stages, with output speed and torque."},"description":"Gear-train ratio calculator: single-pair ratio with speed and torque, compound-train overall ratio, and speed/ratio solving."},"meta":{"timestamp":"2026-06-04T18:38:22.764Z","request_id":"1911ad03-0aff-4a22-8eeb-56f329b4382d"},"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":3000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":800,"monthly_call_quota":40000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2200,"monthly_call_quota":250000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6900,"monthly_call_quota":1500000,"rps_limit":60,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/gearratio-api"}