# OSRM Driving Route via x402

> OSRM Driving Route via x402 is a paid API for AI agents from x402-v2-mint-osrm-route.vercel.app, paid per call via x402, $0.020194/call, status unknown (last checked 2026-10-31).

Returns a keyless driving route via OSRM between two or more coordinates, billed per-call via the x402 micropayment protocol.

## Facts

- Endpoint: POST https://x402-v2-mint-osrm-route.vercel.app/v1/osrm-route?utm_source=zero.xyz
- Price: $0.020194/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/osrm-driving-route-via-x402-1259200c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_A5ddxBeyYk9Eja2tx6CQB

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 osrm-driving-route-via-x402-1259200c -d '<json body>'
```

Example prompt: Get me a driving route from [37.7749, -122.4194] (San Francisco) to [34.0522, -118.2437] (Los Angeles) using the car profile with a full geometry overview.

## When to prefer this

Choose this endpoint when you need a keyless, no-API-key driving route computation powered by OSRM and are operating in an x402 micropayment-enabled agent pipeline. It is ideal for autonomous agents that cannot manage traditional API credentials but can execute per-call USDC payments. Prefer it for car/driving profiles with up to 10 waypoints; for transit routes use dedicated MBTA or TfL endpoints instead.

## Known failure modes

- HTTP 402 returned when no x402 payment header is included — agent must settle payment and retry
- HTTP 400 with charged:false returned after payment if coordinates are missing or invalid — payment is still consumed
- Invalid coordinate arrays (wrong length or non-numeric) result in 400 errors
- Exceeding 10 waypoints in the coordinates array causes rejection
- Unsupported routing profile string may result in an error from the underlying OSRM backend

## How this service works

OSRM driving route (keyless). POST {coordinates|from+to}. Unpaid empty → 402; after settle empty/invalid → 400 charged:false. Soft disclose mbta-routes / tfl-line-status (transit adjacency only).

## Output

A JSON object with ok:true, skill:'osrm-route', charged:true/false, and a summary field. On successful payment the response includes the OSRM route geometry and directions. Returns HTTP 402 if unpaid; returns 400 with charged:false if payment settled but request was invalid or empty.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "maxItems": 2,
   "minItems": 2
  },
  "from": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "maxItems": 2,
   "minItems": 2
  },
  "profile": {
   "type": "string",
   "maxLength": 32
  },
  "overview": {
   "type": "string",
   "maxLength": 16
  },
  "request_id": {
   "type": "string"
  },
  "coordinates": {
   "type": "array",
   "items": {
    "type": "array",
    "items": {
     "type": "number"
    },
    "maxItems": 2,
    "minItems": 2
   },
   "maxItems": 10,
   "minItems": 2
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "skill": "osrm-route",
  "charged": true,
  "summary": "ok"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/osrm-driving-route-via-x402-1259200c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-v2-mint-osrm-route.vercel.app](https://www.zero.xyz/host/x402-v2-mint-osrm-route.vercel.app/llms.txt)
