{"openapi":"3.1.0","info":{"title":"Roller Chain Drive API","version":"1.0.0","description":"Roller-chain drive maths as an API, computed locally and deterministically — the chain-length, sprocket and speed numbers a machine designer or millwright lays out a drive with. The chain-length endpoint gives the chain in pitches from the two sprocket tooth counts, the chain pitch and the centre distance: L = 2·C + (N1+N2)/2 + ((N2−N1)/2π)² ÷ C (C in pitches), rounded UP to an even number so the chain closes without an offset link — a 17- and 34-tooth pair at 15-inch centres on #40 (half-inch) chain comes to 86 pitches, 43 inches. The sprocket endpoint gives the pitch diameter, pitch ÷ sin(180°/teeth), and the outside diameter — a 17-tooth #40 sprocket has a 2.72-inch pitch circle. The speed endpoint gives the chain's linear speed, pitch × teeth × rpm ÷ 12, so a 17-tooth #40 sprocket at 100 rpm runs the chain at about 71 ft/min. Everything is computed locally and deterministically, so it is instant and private. Ideal for machine-design and drivetrain apps, conveyor and equipment-build tools, maker and CAD calculators, and engineering aids. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. For gear ratios use a gear-ratio API; for belts use a pulley API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/chaindrive-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/chain-length":{"get":{"operationId":"get_v1_chain_length","tags":["Chain"],"summary":"Chain length from sprockets & centre","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":"34"},{"name":"pitch_in","in":"query","required":true,"description":"Chain pitch in inches (#40 = 0.5)","schema":{"type":"string"},"example":"0.5"},{"name":"center_distance_in","in":"query","required":true,"description":"Centre distance in inches","schema":{"type":"string"},"example":"15"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Chain length in pitches = 2·C + (N1+N2)/2 + ((N2−N1)/2π)² ÷ C, with C the centre distance in pitches — then round UP to an even number so the chain closes without an offset link. The slack side should sag on the bottom; if you can't get an even count at the exact centre, nudge the centre distance or add a tensioner.","inputs":{"pitch_in":0.5,"driven_teeth":34,"driver_teeth":17,"center_distance_in":15},"exact_pitches":85.74,"chain_length_in":43,"chain_length_pitches":86},"meta":{"timestamp":"2026-06-06T23:53:58.407Z","request_id":"b31b466d-b076-4dec-a898-9bcea2016ce1"},"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/speed":{"get":{"operationId":"get_v1_speed","tags":["Chain"],"summary":"Chain linear speed","description":"","parameters":[{"name":"teeth","in":"query","required":true,"description":"Sprocket teeth","schema":{"type":"string"},"example":"17"},{"name":"pitch_in","in":"query","required":true,"description":"Chain pitch in inches","schema":{"type":"string"},"example":"0.5"},{"name":"rpm","in":"query","required":true,"description":"Sprocket speed in rpm","schema":{"type":"string"},"example":"100"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Chain speed = pitch × teeth × rpm ÷ 12 (the sprocket's pitch circumference per turn). Standard roller chain is happy up to a few thousand ft/min; beyond that you need better lubrication and finer pitch to control wear and noise. Faster chain at the same power means lower tension and a longer life.","inputs":{"rpm":100,"teeth":17,"pitch_in":0.5},"chain_speed_ft_s":1.18,"chain_speed_ft_min":70.8},"meta":{"timestamp":"2026-06-06T23:53:58.513Z","request_id":"07bef5ec-893b-45f7-b205-3869ec9a64e1"},"status":"ok","message":"Chain speed","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/sprocket":{"get":{"operationId":"get_v1_sprocket","tags":["Chain"],"summary":"Sprocket pitch & outside diameter","description":"","parameters":[{"name":"teeth","in":"query","required":true,"description":"Number of teeth","schema":{"type":"string"},"example":"17"},{"name":"pitch_in","in":"query","required":true,"description":"Chain pitch in inches","schema":{"type":"string"},"example":"0.5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Pitch diameter = pitch ÷ sin(180°/teeth) — the circle the chain pins ride on. The outside (tip) diameter is a touch larger, ≈ pitch × (0.6 + cot(180°/teeth)). More teeth runs smoother and quieter with less 'chordal' speed variation; keep the small sprocket to 17+ teeth where you can.","inputs":{"teeth":17,"pitch_in":0.5},"pitch_diameter_in":2.721,"outside_diameter_in":2.975},"meta":{"timestamp":"2026-06-06T23:53:58.596Z","request_id":"6b4e2824-a9e8-4926-980e-15b4215e70f1"},"status":"ok","message":"Sprocket diameter","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":"US units (inches, teeth, rpm). L = 2C + (N1+N2)/2 + ((N2−N1)/2π)²/C (round up to even); PCD = pitch/sin(180°/N); speed = pitch·teeth·rpm/12. ANSI #40 = 0.5\" pitch. For gear ratios use a gear-ratio API; for belts use a pulley API.","service":"chaindrive-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/speed":"Chain linear speed from teeth, pitch and rpm.","GET /v1/sprocket":"Sprocket pitch and outside diameter from teeth and pitch.","GET /v1/chain-length":"Chain length (pitches & inches) from sprocket teeth, pitch and centre distance."},"description":"Roller-chain drive maths: chain length from sprockets and centre distance, sprocket pitch/outside diameter, and chain linear speed."},"meta":{"timestamp":"2026-06-06T23:53:58.683Z","request_id":"ca8c53ab-0388-4d6a-b452-c4c0b48cd93b"},"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":490,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":555,"monthly_call_quota":12900,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1750,"monthly_call_quota":81000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5180,"monthly_call_quota":264000,"rps_limit":36,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/chaindrive-api"}