# Bicycle Chain Length Calculator

> Bicycle Chain Length Calculator is a paid API for AI agents from bike-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Calculates the required bicycle chain length in links (rounded up to the nearest even number) from chainstay length, chainring teeth, and rear cog teeth.

## Facts

- Endpoint: GET https://bike-calc.x402tookit.com/chain-length?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bicycle-chain-length-calculator-0b87ae06
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_M2pVGPb_RFB41D8eMiwtS

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability bicycle-chain-length-calculator-0b87ae06
```

Example prompt: What chain length do I need for my bike — the chainstay is 425mm, I'm running a 50-tooth chainring and an 11-tooth rear cog? Give me the number of links rounded up to the nearest even number.

## When to prefer this

Choose this endpoint when you need a quick, formula-based chain length calculation from known drivetrain geometry — specifically chainstay length plus chainring and cog tooth counts. It is ideal for bike builds, chain replacements, or drivetrain changes where the user already knows their frame and gearing specs. Prefer this over manual calculation or generic cycling guides when you need a precise link count ready to act on.

## Known failure modes

- Missing required parameters (chainstayMm, chainring, or cog) returns a validation error
- Non-integer values for chainring or cog teeth may be rejected
- Chainstay values outside the typical 405–440mm range may still compute but could yield unrealistic results
- Unusual chain pitch values (other than standard 0.5 inch) require explicit pitchInches parameter or default is assumed

## How this service works

Chain length in links, rounded up to even, from chainstay length and chainring and cog teeth, with the exact figure.

## Output

Returns the chain length in whole links rounded up to the nearest even number, the exact (unrounded) link count, chain length in millimetres and inches, the chainstay converted to inches, the tooth difference between chainring and cog, and the chain pitch used in the calculation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "chainstayMm",
      "chainring",
      "cog"
     ],
     "properties": {
      "cog": {
       "type": "integer",
       "description": "Rear cog teeth in use (the biggest cog, for a derailleur bike)"
      },
      "chainring": {
       "type": "integer",
       "description": "Chainring teeth in use (the biggest, for a derailleur bike)"
      },
      "chainstayMm": {
       "type": "number",
       "description": "Centre-to-centre distance between bottom bracket and rear axle in mm (typically 405 to 440)"
      },
      "pitchInches": {
       "type": "number",
       "description": "Chain pitch in inches (default 0.5, standard bicycle chain)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "pairs": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "exactLinks": {
       "type": [
        "null",
        "number"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "pitchInches": {
       "type": [
        "null",
        "number"
       ]
      },
      "chainLengthMm": {
       "type": [
        "null",
        "number"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bicycle-chain-length-calculator-0b87ae06/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bike-calc.x402tookit.com](https://www.zero.xyz/host/bike-calc.x402tookit.com/llms.txt)
