{"openapi":"3.1.0","info":{"title":"Roller Chain Drive API","version":"1.0.0","description":"Roller-chain power-transmission maths as an API, computed locally and deterministically. The ratio endpoint computes a chain drive's speed ratio (driven ÷ driver teeth), the output rpm and torque multiplier, the chain (line) velocity v = N·p·rpm/60 and the pitch diameter of each sprocket, PD = p/sin(π/N), from the driver and driven tooth counts, the input speed and the chain pitch. The length endpoint computes the chain length in pitches and then rounds it up to an even number of links — links must come in pairs — using L = 2C/p + (N1+N2)/2 + ((N2−N1)/2π)²·p/C from the tooth counts, the centre distance and the pitch. The center-distance endpoint inverts that relation to give the exact centre distance for a chosen even link count, C = (p/8)·[(2L−N1−N2) + √((2L−N1−N2)² − 8·((N2−N1)/2π)²)]. Tooth counts are integers, pitch and centre distance in metres (the default pitch 0.0127 m is ANSI 40, ½ inch) and speeds in rpm. Everything is computed locally and deterministically, so it is instant and private. Ideal for mechanical, machine-design, conveyor, motorcycle and industrial-equipment app developers, sprocket-sizing and chain-selection tools, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is industrial roller-chain drives; for bicycle gearing use a bike-gear API and for belt or gear ratios a gear-ratio API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/chain-api","description":"oanor gateway"}],"tags":[{"name":"Chain"},{"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/center-distance":{"get":{"operationId":"get_v1_center_distance","tags":["Chain"],"summary":"Centre distance","description":"","parameters":[{"name":"driver_teeth","in":"query","required":true,"description":"Driver teeth","schema":{"type":"string"},"example":"17"},{"name":"driven_teeth","in":"query","required":true,"description":"Driven teeth","schema":{"type":"string"},"example":"42"},{"name":"links","in":"query","required":true,"description":"Chain length (even links)","schema":{"type":"string"},"example":"110"},{"name":"pitch","in":"query","required":false,"description":"Chain pitch (m)","schema":{"type":"string"},"example":"0.0127"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Centre distance C = (p/8)·[(2L−N1−N2) + √((2L−N1−N2)² − 8·((N2−N1)/2π)²)] for a given even link count L.","inputs":{"links":110,"pitch_m":0.0127,"driven_teeth":42,"driver_teeth":17},"center_distance_m":0.51055,"center_distance_mm":510.5498},"meta":{"timestamp":"2026-06-05T11:30:25.740Z","request_id":"9ecefe3e-4c51-4f27-bf96-0c2e91d95ea0"},"status":"ok","message":"Center distance","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/length":{"get":{"operationId":"get_v1_length","tags":["Chain"],"summary":"Chain length","description":"","parameters":[{"name":"driver_teeth","in":"query","required":true,"description":"Driver teeth","schema":{"type":"string"},"example":"17"},{"name":"driven_teeth","in":"query","required":true,"description":"Driven teeth","schema":{"type":"string"},"example":"42"},{"name":"center_distance","in":"query","required":true,"description":"Centre distance (m)","schema":{"type":"string"},"example":"0.5"},{"name":"pitch","in":"query","required":false,"description":"Chain pitch (m)","schema":{"type":"string"},"example":"0.0127"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Chain length in pitches L = 2C/p + (N1+N2)/2 + ((N2−N1)/2π)²·p/C, rounded up to an even number of links (links must be even). The actual centre distance is slightly less than requested.","inputs":{"pitch_m":0.0127,"driven_teeth":42,"driver_teeth":17,"center_distance_m":0.5},"length_m":1.397,"length_links":110,"length_pitches":108.6423},"meta":{"timestamp":"2026-06-05T11:30:25.852Z","request_id":"e957aed6-f019-46f7-9b4a-ca7dfc5c206e"},"status":"ok","message":"Chain length","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/ratio":{"get":{"operationId":"get_v1_ratio","tags":["Chain"],"summary":"Chain ratio & velocity","description":"","parameters":[{"name":"driver_teeth","in":"query","required":true,"description":"Driver sprocket teeth","schema":{"type":"string"},"example":"17"},{"name":"driven_teeth","in":"query","required":true,"description":"Driven sprocket teeth","schema":{"type":"string"},"example":"42"},{"name":"input_rpm","in":"query","required":false,"description":"Input speed (rpm)","schema":{"type":"string"},"example":"1000"},{"name":"pitch","in":"query","required":false,"description":"Chain pitch (m)","schema":{"type":"string"},"example":"0.0127"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Speed ratio = driven/driver teeth. Output torque is multiplied by the ratio; output speed is divided by it. Pitch diameter PD = p/sin(π/N).","inputs":{"pitch_m":0.0127,"driven_teeth":42,"driver_teeth":17},"output_rpm":404.761905,"speed_ratio":2.470588,"chain_velocity_ms":3.598333,"torque_multiplier":2.470588,"driven_pitch_diameter_m":0.169945,"driver_pitch_diameter_m":0.069116},"meta":{"timestamp":"2026-06-05T11:30:25.925Z","request_id":"a25998b3-5e59-4160-bc4f-56a4a22bbe35"},"status":"ok","message":"Chain 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/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 are integers, pitch and centre distance in m (default pitch 0.0127 m = ANSI 40, ½\"). Link counts must be even.","service":"chain-api","formulae":{"ratio":"ratio = N2/N1 ; v = N·p·rpm/60","length":"L = 2C/p + (N1+N2)/2 + ((N2−N1)/2π)²·p/C","pitch_diameter":"PD = p/sin(π/N)"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/ratio":"Speed ratio, output rpm, chain velocity and pitch diameters from sprocket teeth.","GET /v1/length":"Chain length in pitches and even links from the centre distance.","GET /v1/center-distance":"Centre distance for a given even number of links."},"description":"Roller-chain drive calculator: speed ratio, chain velocity and pitch diameters; chain length in links from the centre distance; and the centre distance for a chosen link count."},"meta":{"timestamp":"2026-06-05T11:30:26.013Z","request_id":"b4e9de70-0139-4af4-be6e-563da488a2b5"},"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":2620,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":900,"monthly_call_quota":38800,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2300,"monthly_call_quota":251000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7100,"monthly_call_quota":1670000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/chain-api"}