# Locus x402 Mapbox Directions API

> Locus x402 Mapbox Directions API is a paid API for AI agents from mapbox.x402.paywithlocus.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns turn-by-turn driving, walking, or cycling route directions between coordinates using Mapbox routing, billed per call via x402 micropayment.

## Facts

- Endpoint: POST https://mapbox.x402.paywithlocus.com/mapbox/directions
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/locus-x402-mapbox-directions-api-d82650aa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_O2YIEq9TLuvZx8sTAU0Uw

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 locus-x402-mapbox-directions-api-d82650aa -d '<json body>'
```

Example prompt: Get me driving directions with turn-by-turn instructions from -73.99,40.73 to -77.03,38.90, avoiding tolls, and return the route geometry as GeoJSON in English.

## When to prefer this

Choose this endpoint when you need Mapbox-quality routing with micropayment billing via x402 (no API key subscription required), support for multiple transport modes (driving with/without traffic, walking, cycling), road-type exclusions, and rich annotations including congestion. Prefer over generic geocoding APIs when you need actual route geometry and turn-by-turn navigation data.

## Known failure modes

- Invalid coordinates format (not semicolon-separated lon,lat pairs) returns an error
- Unsupported routing profile string returns a validation error
- Payment failure via x402 protocol blocks the request
- Coordinates outside supported coverage area may return no routes
- Invalid language code may fall back to default or error
- Requesting annotations for unsupported profile may return partial data

## How this service works

Locus public pay-per-use API

## Output

Returns a JSON object containing one or more routes, each with geometry (in the requested format), distance in meters, duration in seconds, optional turn-by-turn step instructions, and optional annotations (speed, duration, distance, congestion, maxspeed, closure) per road segment. Includes up to 2 alternative routes if requested.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "steps": {
   "type": "boolean"
  },
  "exclude": {
   "type": "string"
  },
  "profile": {
   "type": "string"
  },
  "language": {
   "type": "string"
  },
  "overview": {
   "type": "string"
  },
  "geometries": {
   "type": "string"
  },
  "annotations": {
   "type": "string"
  },
  "coordinates": {
   "type": "string"
  },
  "alternatives": {
   "type": "boolean"
  }
 }
}
```

## 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/locus-x402-mapbox-directions-api-d82650aa/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)
