Mapbox Directions API via MPP — pay-per-call routing with turn-by-turn instructions
What it does
This endpoint provides access to the Mapbox Directions API through the Locus Micropayment Protocol (MPP). It accepts a POST request with a routing profile (driving, driving-traffic, walking, or cycling) and semicolon-separated coordinate pairs, returning route geometry, distance, duration, and optional turn-by-turn navigation steps. Additional parameters allow requesting alternative routes, annotations (speed, congestion, closures), geometry format selection (GeoJSON, polyline, polyline6), language for instructions, and exclusion of specific road types like tolls or ferries.
The endpoint is part of a broader Mapbox suite available on the same MPP gateway, which also includes forward/reverse geocoding, isochrone generation, matrix routing, map matching, static map images, and tile queries. Each call is settled individually via the Tempo method on pathUSD. The Directions endpoint is priced at 5000 base units of pathUSD (6 decimals), which equals $0.005 per request.
Note that the probe returned 404 on HEAD and GET requests to this specific path, which is expected behavior since the endpoint only accepts POST. The OpenAPI spec from the gateway clearly documents the endpoint with full request schema and payment info, confirming it is available.
Capabilities
Use cases
- —Computing driving/walking/cycling routes between two or more waypoints for a logistics or delivery application
- —Generating turn-by-turn navigation instructions for a mobile or web mapping interface
- —Comparing alternative routes with congestion annotations to find the fastest path
- —Building trip-planning agents that need distance and duration estimates between locations
- —Excluding toll roads or ferries from route calculations for cost-sensitive routing
Fit
Best for
- —AI agents needing on-demand routing without managing Mapbox API keys
- —Pay-per-call access to Mapbox Directions without subscription commitments
- —Applications requiring multi-modal routing profiles (driving, walking, cycling)
- —Developers integrating route computation into automated workflows
Not for
- —High-volume batch routing where a direct Mapbox subscription would be cheaper
- —Real-time turn-by-turn navigation requiring persistent streaming connections
- —Offline or embedded routing without network access
Quick start
curl -X POST https://mapbox.mpp.paywithlocus.com/mapbox/directions \
-H "Content-Type: application/json" \
-d '{
"profile": "mapbox/driving",
"coordinates": "-73.99,40.73;-77.03,38.90",
"steps": true,
"geometries": "geojson"
}'Example
Request
{
"steps": true,
"profile": "mapbox/driving",
"language": "en",
"overview": "full",
"geometries": "geojson",
"annotations": "duration,distance,congestion",
"coordinates": "-73.99,40.73;-77.03,38.90",
"alternatives": true
}Endpoint
Quality
Full OpenAPI schema with detailed request parameters and clear pricing is available. However, the probe did not capture a live 402 challenge on this specific endpoint (404 on HEAD/GET, which is expected for a POST-only route), no example response is available, and crawled pages returned no additional documentation. The endpoint is likely live but unconfirmed via probe.
Warnings
- —Probe returned 404 on HEAD and GET — endpoint is POST-only, so liveness could not be confirmed via the probe methods used
- —No example response body is available in the source material; response structure is inferred from Mapbox's public API documentation
- —The currency address 0x20c000000000000000000000b9537d11c60e8b50 is assumed to be pathUSD with 6 decimals based on the Tempo settlement method; if this assumption is wrong, the price of $0.005 may be incorrect
Citations
- —The Directions endpoint requires profile and coordinates parameters, supports alternatives, steps, annotations, geometries, overview, language, and exclude optionshttps://mapbox.mpp.paywithlocus.com
- —The Directions endpoint is priced at 5000 base units via Tempo settlement methodhttps://mapbox.mpp.paywithlocus.com
- —The broader Mapbox MPP gateway includes geocoding, directions, isochrones, matrix, map matching, static images, and tilequery endpointshttps://mapbox.mpp.paywithlocus.com
- —Mapbox API reference documentation is available at docs.mapbox.com/api/https://docs.mapbox.com/api/Directions