# Worm Gear API
> Worm-gear engineering maths as an API, computed locally and deterministically — the ratio, lead-angle and efficiency numbers a machine designer or millwright sizes a worm drive with. The ratio endpoint gives the reduction = wheel teeth ÷ worm starts, so a single-start worm on a 40-tooth wheel is a big 40:1 reduction in one compact stage — the high ratio in a small package is the whole appeal of a worm drive. The geometry endpoint gives the lead (= starts × axial pitch, with axial pitch = π × module) and the lead angle = atan(lead ÷ (π × worm pitch diameter)), and tests for self-locking: a small lead angle (roughly under 5–6° for typical steel-on-bronze) means the wheel cannot back-drive the worm — invaluable for hoists and holding loads, at the cost of efficiency. The efficiency endpoint gives the mesh efficiency when the worm drives = tan(lead angle) ÷ tan(lead angle + friction angle), which is low for the small lead angles that give big ratios — often 50–70 %, which is why worm gears run warm and need good lubrication — while high-lead multi-start worms reach 90 %+; when the lead angle drops to the friction angle the drive becomes self-locking. Everything is computed locally and deterministically, so it is instant and private. Ideal for mechanical-design and gearbox tools, machine-building and CAD utilities, and engineering calculators. Pure local computation — no key, no third-party service, instant. Confirm self-locking dynamically — vibration can unlock a marginal pair. 3 compute endpoints. For spur gears use a spur-gear API; for a general ratio a gear-ratio API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/wormgear-api/..."
```

## Pricing
- **Free** (Free) — 4,600 calls/Mo, 2 req/s
- **Starter** ($13/Mo) — 51,000 calls/Mo, 6 req/s
- **Pro** ($39/Mo) — 217,000 calls/Mo, 15 req/s
- **Mega** ($121/Mo) — 1,120,000 calls/Mo, 40 req/s

## Endpoints

### Worm

#### `GET /v1/efficiency` — Mesh efficiency (worm driving)

**Parameters:**
- `lead_angle_deg` (query, required, string) — Lead angle (degrees) Example: `3.814`
- `friction_coeff` (query, optional, string) — Friction coefficient (default 0.05) Example: `0.05`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wormgear-api/v1/efficiency?lead_angle_deg=3.814&friction_coeff=0.05"
```

#### `GET /v1/geometry` — Lead angle and self-locking test

**Parameters:**
- `worm_starts` (query, required, string) — Worm starts (threads) Example: `1`
- `module_mm` (query, required, string) — Axial module (mm) Example: `2`
- `worm_pitch_diameter_mm` (query, required, string) — Worm pitch diameter (mm) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wormgear-api/v1/geometry?worm_starts=1&module_mm=2&worm_pitch_diameter_mm=30"
```

#### `GET /v1/ratio` — Gear ratio from starts and teeth

**Parameters:**
- `worm_starts` (query, required, string) — Worm starts (threads) Example: `1`
- `gear_teeth` (query, required, string) — Wheel teeth Example: `40`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wormgear-api/v1/ratio?worm_starts=1&gear_teeth=40"
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wormgear-api/v1/meta"
```


---
Marketplace page: https://www.oanor.com/api/wormgear-api
OpenAPI spec: https://www.oanor.com/api/wormgear-api/openapi.json
