# Mapbox Matrix Routing via Locus x402

> Mapbox Matrix Routing via Locus x402 is a paid API for AI agents from mapbox.x402.paywithlocus.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-13).

Computes travel duration and/or distance matrices between multiple origin and destination coordinates using Mapbox routing profiles, billed per-call via x402 micropayment.

## Facts

- Endpoint: POST https://mapbox.x402.paywithlocus.com/mapbox/matrix?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mapbox-matrix-routing-via-locus-x402-e3e98ba9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lt83eV0pbiXtbvR31qP6_

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 mapbox-matrix-routing-via-locus-x402-e3e98ba9 -d '<json body>'
```

Example prompt: Compute a driving travel time and distance matrix for these 5 locations — warehouse at -122.4194,37.7749, and delivery stops at -122.4089,37.7869, -122.3988,37.7831, -122.4312,37.7654, and -122.4001,37.7701 — using the mapbox/driving profile with duration and distance annotations.

## When to prefer this

Use this endpoint when you need to compute travel times or distances between multiple origins and multiple destinations simultaneously (O×D matrix), rather than a single point-to-point route. Ideal for logistics optimization, fleet dispatch, and clustering problems where pairwise travel costs are needed. Prefer over single-directions endpoints when you have 2–25 locations and need all pairwise combinations efficiently in one call.

## Known failure modes

- More than 25 coordinates provided (or more than 10 for traffic profile) — API rejects with validation error
- Invalid routing profile string — returns error indicating unsupported profile
- Malformed coordinate format (wrong separator or order) — parse error
- Coordinates in ocean or unsupported region — no route found for certain pairs
- Payment failure or insufficient USDC balance — transaction not settled, no result returned

## How this service works

Location and mapping APIs — geocoding, directions, isochrones, matrix routing, map matching, static maps, and spatial queries.

## Output

A JSON object containing a matrix of travel durations (in seconds) and/or distances (in meters) for each source-to-destination pair, plus payment confirmation details (settled USDC amount, request ID, and status URL).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "profile": {
   "type": "string"
  },
  "sources": {
   "type": "string"
  },
  "approaches": {
   "type": "string"
  },
  "annotations": {
   "type": "string"
  },
  "coordinates": {
   "type": "string"
  },
  "destinations": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "payment": {
   "scheme": "exact",
   "settledUsdc": "0.001000",
   "authorizedMaxUsdc": "0.001000"
  },
  "request": {
   "id": "00000000-0000-4000-8000-000000000000",
   "statusUrl": "/requests/00000000-0000-4000-8000-000000000000"
  },
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mapbox-matrix-routing-via-locus-x402-e3e98ba9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mapbox.x402.paywithlocus.com](https://www.zero.xyz/host/mapbox.x402.paywithlocus.com/llms.txt)
