# Mapbox Matrix

> Mapbox Matrix is a paid API for AI agents from Mapbox at mapbox.mpp.paywithlocus.com, paid per call via MPP, $0.002/element (dynamic), status unknown (last checked 2026-10-10).

Computes travel durations and/or distances between multiple origin and destination coordinate pairs using a specified routing profile

## Facts

- Endpoint: POST https://mapbox.mpp.paywithlocus.com/mapbox/matrix?utm_source=zero.xyz
- Price: $0.002/element (dynamic)
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Provider: Mapbox
- Docs: https://docs.mapbox.com/api/
- Website: https://www.mapbox.com
- Tags: maps, geocoding, directions, routing, geospatial, data
- Canonical page: https://www.zero.xyz/c/mapbox-matrix-c6702c7e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8ghTz1wL7q8JHsnyZL1NZ

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-c6702c7e -d '<json body>'
```

Example prompt: Using the Mapbox Matrix API, calculate the driving travel times and distances from my warehouse at -87.6298,41.8781 to each of these three delivery stops: -87.6234,41.8827; -87.6412,41.8690; -87.6501,41.8756 — use the mapbox/driving profile and return both duration and distance.

## When to prefer this

Use this endpoint when you need to compute travel times or distances between multiple origin-destination pairs simultaneously, especially for logistics, fleet routing, nearest-facility problems, or any scenario requiring an O(m×n) travel cost matrix. It is far more efficient than calling the Directions endpoint repeatedly for each pair.

## Known failure modes

- Invalid coordinate format returns 400 Bad Request
- More than 25 coordinates (or 10 for traffic profile) returns an error
- Invalid routing profile string returns 422
- Out-of-range coordinates (not on a routable road) may return null durations for affected pairs
- Malformed sources/destinations indices return an error
- Network timeout on large matrices

## How this service works

Calculate travel time and distance between many origins and destinations. Billed per element (sources × destinations).

## Output

Returns a matrix of travel durations (in seconds) and/or distances (in meters) between all requested source and destination coordinate pairs, along with the routing profile used and the snapped waypoint locations.

## Example request

```json
{
 "profile": "mapbox/driving",
 "annotations": "duration,distance",
 "coordinates": "-87.6298,41.8781;-87.6234,41.8827;-87.6412,41.8690"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "profile",
  "coordinates"
 ],
 "properties": {
  "profile": {
   "type": "string",
   "description": "Routing profile: mapbox/driving, mapbox/driving-traffic, mapbox/walking, mapbox/cycling"
  },
  "sources": {
   "type": "string",
   "description": "Semicolon-separated indices for source coordinates (for asymmetric matrices)"
  },
  "approaches": {
   "type": "string",
   "description": "Semicolon-separated approach per coordinate: unrestricted or curb"
  },
  "annotations": {
   "type": "string",
   "description": "Comma-separated: duration, distance (or both)"
  },
  "coordinates": {
   "type": "string",
   "description": "Semicolon-separated lon,lat pairs (2-25, max 10 for traffic)"
  },
  "destinations": {
   "type": "string",
   "description": "Semicolon-separated indices for destination coordinates"
  }
 },
 "additionalProperties": true
}
```

## More

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