# ForgeMesh Distance Calculator

> ForgeMesh Distance Calculator is a paid API for AI agents from x402.forgemesh.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Calculates great-circle (haversine) distance between two geographic coordinates in km, miles, and nautical miles, plus the initial compass bearing

## Facts

- Endpoint: POST https://x402.forgemesh.io/distance-between
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/forgemesh-distance-calculator-2ded60dc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zK7V0gqNzohTx3hcf1KuW

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 forgemesh-distance-calculator-2ded60dc -d '<json body>'
```

Example prompt: What's the straight-line distance and initial compass bearing between coordinates 40.7128° N, 74.0060° W (New York) and 51.5074° N, 0.1278° W (London)? Give me the result in km, miles, and nautical miles.

## When to prefer this

Use this endpoint when you need a fast, deterministic, auditable great-circle distance computation between two known coordinate pairs — especially in logistics, delivery routing, travel estimation, or any context where arithmetic hallucination from LLM reasoning would be unacceptable. Pair with the /geocode-city sibling endpoint when starting from city names rather than raw coordinates. Prefer over LLM self-computation whenever citability or correctness guarantees matter.

## Known failure modes

- Missing or non-numeric lat/lon values return a validation error
- Coordinates out of valid range (lat beyond ±90, lon beyond ±180) may return an error or incorrect result
- Identical input coordinates return zero distance and undefined or arbitrary bearing
- Payment failure or insufficient USDC balance blocks the call with a 402 response

## How this service works

Distance calculator API: great-circle (haversine) distance between two coordinates in km, miles, and nautical miles, plus initial compass bearing. Deterministic and auditable — cheaper than burning reasoning tokens, zero arithmetic-hallucination risk, and the result can be cited. For logistics, travel, delivery, and geo agents. Pairs with /geocode-city for name inputs.

## Output

Returns the great-circle distance between the two coordinate pairs in three units (kilometers, miles, nautical miles) plus the initial compass bearing in degrees — fully deterministic and citable, with no arithmetic approximation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat1": {
   "type": "string"
  },
  "lat2": {
   "type": "string"
  },
  "lon1": {
   "type": "string"
  },
  "lon2": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "km": 2281.55,
  "miles": 1417.7,
  "initial_bearing_deg": 51.5
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/forgemesh-distance-calculator-2ded60dc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.forgemesh.io](https://www.zero.xyz/host/x402.forgemesh.io/llms.txt)
