# Route & Delivery Optimisation API > TSP and capacitated/time-window VRP, pickup-delivery, multi-day plans, territory clustering, depot location, ETAs, load sequencing, driver assignment, slot capacity, geofences and polyline codec — pure computation on caller matrices or coordinates. Each paid operation uses a fixed USDC price on Base with the x402 exact scheme. Unpaid GET, HEAD, and POST return 402 payment terms (POST validates the body only after payment terms are satisfied). A request that carries payment-signature is not yet charged: settlement happens only after a successful (2xx) result. HTTP 4xx/5xx are not charged. Coverage bodies with status complete, partial, or failed all return HTTP 200 and are charged at the full listed price. Settled 2xx responses include a payment-response header; 4xx/5xx do not. Follow https://www.brainiac.software/agent-instructions.txt for install, payment pins, idempotency, and billing rules. - Product: https://www.brainiac.software/api/route-optimization - Docs: https://www.brainiac.software/api/route-optimization/docs - OpenAPI: https://www.brainiac.software/api/route-optimization/openapi.json - Contact: support@brainiac.software (https://www.brainiac.software/contact) ## Operations ### POST /api/v1/route-optimization/distance-matrix $0.02 USDC. Build a haversine distance and estimated duration matrix from caller coordinates with optional circuity and speed. Inputs: locations, circuity?, speedKph?, speedMps? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-distance-matrix Example request: ```json { "locations": [ { "id": "london", "lat": 51.5074, "lon": -0.1278 }, { "id": "paris", "lat": 48.8566, "lon": 2.3522 } ], "circuity": 1, "speedKph": 80 } ``` Example response: ```json { "ids": [ "london", "paris" ], "distancesM": [ [ 0, 343557 ], [ 343557, 0 ] ], "durationsS": [ [ 0, 15460 ], [ 15460, 0 ] ], "estimate": true, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Haversine with IUGG mean radius 6,371,008.8 m; duration = distance / (speedKph/3.6), rounded to whole metres/seconds.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/tsp-optimize $0.05 USDC. Find a best visiting order for one vehicle (closed tour or open path) with fixed start and optional fixed end using Held-Karp or local search. Inputs: locations, matrix?, matrixFromPoints?, circuity?, speedMps?, speed?, start, end?, objective?, timeLimitMs? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-tsp-optimize Example request: ```json { "locations": [ { "id": "depot", "x": 0, "y": 0 }, { "id": "s1", "x": 2, "y": 6 }, { "id": "s2", "x": 5, "y": 2 }, { "id": "s3", "x": 6, "y": 6 }, { "id": "s4", "x": 8, "y": 3 }, { "id": "s5", "x": 1, "y": 3 }, { "id": "s6", "x": 4, "y": 8 } ], "matrixFromPoints": "euclidean", "start": "depot", "end": "depot", "objective": "distance", "timeLimitMs": 2000 } ``` Example response: ```json { "sequence": [ "depot", "s2", "…" ], "totalDistance": 24.1344033126, "totalDuration": 24.1344033126, "method": "held_karp", "optimal": true, "estimate": true, "timeLimitMs": 2000, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "TSP ≤ 12 stops uses Held-Karp; larger instances use nearest neighbour + Or-opt/2-opt with timeLimitMs.", "Caps: 2,000 stops.", "…" ] } ``` ### POST /api/v1/route-optimization/vrp-capacitated $0.05 USDC. Assign stops to vehicles under capacity (and optional duration) limits, returning routes with loads and distances. Inputs: depot, stops, vehicles, matrix?, matrixFromPoints?, circuity?, speedMps?, speed?, maxRouteDuration?, minimise?, timeLimitMs? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-vrp-capacitated Example request: ```json { "depot": { "id": "depot", "x": 0, "y": 0 }, "stops": [ { "id": "a", "x": 2, "y": 6, "demand": 4 }, { "id": "b", "x": 5, "y": 2, "demand": 3 }, { "id": "c", "x": 6, "y": 6, "demand": 5 }, { "id": "d", "x": 8, "y": 3, "demand": 2 }, { "id": "e", "x": 1, "y": 3, "demand": 3 }, { "id": "f", "x": 4, "y": 8, "demand": 4 } ], "vehicles": [ { "id": "v1", "capacity": 10 }, { "id": "v2", "capacity": 10 }, { "id": "v3", "capacity": 10 } ], "matrixFromPoints": "euclidean", "maxRouteDuration": null, "minimise": "distance" } ``` Example response: ```json { "routes": [ { "vehicle": "v1", "stops": [ "a", "f" ], "load": 8, "distance": 18.0972543551, "duration": 18.0972543551 }, { "vehicle": "v2", "stops": [ "b", "d", "…" ], "load": 10, "distance": 20.638275117, "duration": 20.638275117 }, "…" ], "totalDistance": 45.0600847924, "unassigned": [], "method": "exact_enumeration", "optimal": true, "estimate": true, "timeLimitMs": 2000, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "VRP ≤ 8 stops uses assignment enumeration with per-route Held-Karp; larger instances use Clarke-Wright + local search.", "Caps: 2,000 stops, 100 vehicles.", "…" ] } ``` ### POST /api/v1/route-optimization/vrp-time-windows $0.05 USDC. Route stops under customer time windows, service times, driver shifts and breaks with forward time propagation. Inputs: depot, stops, vehicles, matrix?, matrixFromPoints?, circuity?, speed?, speedMps?, minimise?, timeLimitMs? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-vrp-time-windows Example request: ```json { "depot": { "id": "depot", "x": 0, "y": 0, "window": [ 0, 100 ] }, "stops": [ { "id": "a", "x": 2, "y": 6, "window": [ 25, 40 ], "service": 2 }, { "id": "b", "x": 5, "y": 2, "window": [ 0, 10 ], "service": 2 }, { "id": "c", "x": 6, "y": 6, "window": [ 15, 30 ], "service": 2 }, { "id": "d", "x": 8, "y": 3, "window": [ 5, 20 ], "service": 2 }, { "id": "e", "x": 1, "y": 3, "window": [ 35, 50 ], "service": 2 } ], "vehicles": [ { "id": "v1", "shift": [ 0, 100 ], "breaks": [] } ], "matrixFromPoints": "euclidean", "speed": 1, "minimise": "completion_time" } ``` Example response: ```json { "routes": [ { "vehicle": "v1", "stops": [ { "id": "b", "arrival": 5.38516480713, "start": 5.38516480713, "wait": 0, "departure": 7.38516480713 }, { "id": "d", "arrival": 10.5474424673, "start": 10.5474424673, "wait": 0, "departure": 12.5474424673 }, "…" ], "end": 40.1622776602, "totalWait": 7.68472859706, "distance": 22.4775490631 } ], "unassigned": [], "method": "exact_enumeration", "optimal": true, "estimate": true, "timeLimitMs": 2000, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Time-window VRP: exact enumeration for small instances; Solomon I1 insertion otherwise.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/pickup-delivery $0.05 USDC. Route paired pickup-and-delivery requests with precedence, same-vehicle and capacity constraints. Inputs: depot, requests, vehicles, matrix?, matrixFromPoints?, circuity?, speed?, timeLimitMs? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-pickup-delivery Example request: ```json { "depot": { "id": "depot", "x": 0, "y": 0 }, "requests": [ { "id": "r1", "pickup": { "id": "p1", "x": 2, "y": 0 }, "delivery": { "id": "d1", "x": 4, "y": 0 }, "quantity": 1 }, { "id": "r2", "pickup": { "id": "p2", "x": 0, "y": 2 }, "delivery": { "id": "d2", "x": 0, "y": 4 }, "quantity": 1 } ], "vehicles": [ { "id": "v1", "capacity": 1 } ], "matrixFromPoints": "euclidean" } ``` Example response: ```json { "routes": [ { "vehicle": "v1", "sequence": [ "depot", "p1", "…" ], "distance": 14.472135955, "maxLoad": 1 } ], "unassigned": [], "method": "exact_enumeration", "optimal": true, "estimate": true, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Pickup-before-delivery precedence with same-vehicle and capacity constraints.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/multi-day-plan $0.05 USDC. Assign recurring visits across a horizon with frequency and spacing rules, then route each day. Inputs: horizonDays, stops, depot, vehiclesPerDay?, capacityPerDay?, matrix?, matrixFromPoints?, timeLimitMs? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-multi-day-plan Example request: ```json { "horizonDays": [ "Mon", "Tue", "Wed", "Thu", "Fri" ], "stops": [ { "id": "s1", "x": 1, "y": 1, "visitsPerWeek": 2, "minGapDays": 2, "allowedDays": null } ], "depot": { "x": 0, "y": 0 }, "vehiclesPerDay": 1, "capacityPerDay": null, "matrixFromPoints": "euclidean" } ``` Example response: ```json { "days": [ { "day": "Mon", "route": [ "s1" ], "distance": 2.82842712475 }, { "day": "Wed", "route": [ "s1" ], "distance": 2.82842712475 } ], "visitPatterns": [ { "stop": "s1", "days": [ "Mon", "Wed" ] } ], "unassigned": [], "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Visit patterns honour frequency and minGapDays; each day is routed with the TSP solver.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/territory-cluster $0.03 USDC. Split stops into k balanced, compact territories with capacitated k-means and imbalance limits. Inputs: stops, k, balanceBy?, maxImbalance?, matrixFromPoints?, seed? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-territory-cluster Example request: ```json { "stops": [ { "id": "1", "x": 0, "y": 0, "weight": 1 }, { "id": "2", "x": 1, "y": 0, "weight": 1 }, { "id": "3", "x": 0, "y": 1, "weight": 1 }, { "id": "4", "x": 1, "y": 1, "weight": 1 }, { "id": "5", "x": 10, "y": 10, "weight": 1 }, { "id": "6", "x": 11, "y": 10, "weight": 1 }, { "id": "7", "x": 10, "y": 11, "weight": 1 }, { "id": "8", "x": 11, "y": 11, "weight": 1 } ], "k": 2, "balanceBy": "weight", "maxImbalance": 0.1, "matrixFromPoints": "euclidean" } ``` Example response: ```json { "territories": [ { "id": 0, "stops": [ "1", "2", "…" ], "size": 4, "centroid": [ 0.5, 0.5 ] }, { "id": 1, "stops": [ "5", "6", "…" ], "size": 4, "centroid": [ 10.5, 10.5 ] } ], "imbalance": 0, "withinSse": 4, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Capacitated k-means with k-means++ (mulberry32) initialisation and capacity mean×(1±maxImbalance).", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/depot-location-optimize $0.04 USDC. Choose p hub locations from candidates to minimise demand-weighted distance, optionally capacitated. Inputs: demand, candidates, p, matrix?, matrixFromPoints?, capacities? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-depot-location-optimize Example request: ```json { "demand": [ { "id": "D1", "x": 0, "y": 0, "weight": 10 }, { "id": "D2", "x": 1, "y": 0, "weight": 5 }, { "id": "D3", "x": 5, "y": 5, "weight": 8 }, { "id": "D4", "x": 6, "y": 5, "weight": 4 }, { "id": "D5", "x": 10, "y": 0, "weight": 6 }, { "id": "D6", "x": 9, "y": 1, "weight": 3 } ], "candidates": [ { "id": "C1", "x": 0, "y": 0 }, { "id": "C2", "x": 1, "y": 1 }, { "id": "C3", "x": 5, "y": 5 }, { "id": "C4", "x": 6, "y": 4 }, { "id": "C5", "x": 10, "y": 0 }, { "id": "C6", "x": 3, "y": 3 } ], "p": 2, "matrixFromPoints": "euclidean", "capacities": null } ``` Example response: ```json { "selected": [ "C1", "C4" ], "objective": 66.9827560573, "allocation": [ { "demand": "D1", "facility": "C1" }, { "demand": "D2", "facility": "C1" }, "…" ], "method": "exhaustive", "optimal": true, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "p-median over candidates; exhaustive when C(n,p) ≤ 100,000, otherwise greedy + Teitz-Bart.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/route-eta-schedule $0.02 USDC. Compute arrivals, waits, slack and overtime for a fixed stop sequence with optional return and shift end. Inputs: start, sequence, returnTo?, matrix?, matrixFromPoints?, speed?, speedMps?, shiftEnd? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-route-eta-schedule Example request: ```json { "start": { "id": "depot", "x": 0, "y": 0, "time": 0 }, "sequence": [ { "id": "b", "x": 5, "y": 2, "window": [ 0, 10 ], "service": 2 }, { "id": "d", "x": 8, "y": 3, "window": [ 5, 20 ], "service": 2 }, { "id": "c", "x": 6, "y": 6, "window": [ 15, 30 ], "service": 2 }, { "id": "a", "x": 2, "y": 6, "window": [ 25, 40 ], "service": 2 }, { "id": "e", "x": 1, "y": 3, "window": [ 35, 50 ], "service": 2 } ], "returnTo": { "x": 0, "y": 0 }, "matrixFromPoints": "euclidean", "speed": 1, "shiftEnd": 100 } ``` Example response: ```json { "stops": [ { "id": "b", "arrival": 5.38516480713, "start": 5.38516480713, "departure": 7.38516480713, "wait": 0, "slack": 4.61483519287, "late": false, "lateBy": 0 }, { "id": "d", "arrival": 10.5474424673, "start": 10.5474424673, "departure": 12.5474424673, "wait": 0, "slack": 9.4525575327, "late": false, "lateBy": 0 }, "…" ], "returnTime": 40.1622776602, "overtime": 0, "violations": [], "totalDistance": 22.4775490631, "estimate": true, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Forward ETA pass on a fixed sequence; late stops are flagged, not rejected.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/vehicle-load-sequence $0.03 USDC. Order parcels last-delivered-first and run a deterministic layer first-fit packing check in a van or truck box. Inputs: box, parcels, units? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-vehicle-load-sequence Example request: ```json { "box": { "length": 300, "width": 170, "height": 180, "maxWeight": 1000 }, "parcels": [ { "id": "p1", "stopIndex": 1, "l": 60, "w": 40, "h": 40, "weight": 20, "rotatable": true }, { "id": "p2", "stopIndex": 2, "l": 60, "w": 40, "h": 40, "weight": 20, "rotatable": true }, { "id": "p3", "stopIndex": 3, "l": 60, "w": 40, "h": 40, "weight": 20, "rotatable": true } ], "units": "cm_kg" } ``` Example response: ```json { "loadingOrder": [ "p3", "p2", "…" ], "fits": true, "volumeUtilisation": 0.0313725490196, "weightUtilisation": 0.06, "placements": [ { "id": "p3", "x": 0, "y": 0, "z": 0, "orientation": "lwh" }, { "id": "p2", "x": 0, "y": 40, "z": 0, "orientation": "lwh" }, "…" ], "method": "layer_first_fit_decreasing", "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Loading order is descending stopIndex (last delivered loads first); layer-first-fit with fixed rotation order.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/driver-shift-assign $0.03 USDC. Assign pre-built routes to drivers by shift, skills and vehicle type with min-cost Hungarian matching. Inputs: routes, drivers, skillMode?, skillPenalty?, allowMultiple? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-driver-shift-assign Example request: ```json { "routes": [ { "id": "R1", "start": 480, "end": 960, "skills": [ "hazmat" ], "vehicleType": "van" }, { "id": "R2", "start": 420, "end": 720, "skills": [], "vehicleType": "van" } ], "drivers": [ { "id": "D1", "shift": [ 420, 1020 ], "skills": [ "hazmat" ], "vehicleTypes": [ "van" ], "cost": 1 }, { "id": "D2", "shift": [ 400, 800 ], "skills": [], "vehicleTypes": [ "van" ], "cost": 1 } ], "skillMode": "strict" } ``` Example response: ```json { "assignments": [ { "route": "R1", "driver": "D1" }, { "route": "R2", "driver": "D2" } ], "unassigned": [], "totalCost": 2, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Min-cost assignment (Hungarian) with shift, vehicle type and skill filters.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/delivery-slot-capacity $0.02 USDC. Estimate bookable orders per zone and time slot from vehicle time, service, drive and stem assumptions. Inputs: zones, slots, booked?, bufferPct?, stemEverySlot? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-delivery-slot-capacity Example request: ```json { "zones": [ { "id": "Z1", "vehicles": 2, "avgServiceMin": 6, "avgDriveBetweenStopsMin": 9, "stemMin": 20 } ], "slots": [ { "id": "09-11", "start": "09:00", "end": "11:00" }, { "id": "11-13", "start": "11:00", "end": "13:00" } ], "booked": [ { "zone": "Z1", "slot": "09-11", "orders": 10 } ], "bufferPct": 0.1 } ``` Example response: ```json { "slots": [ { "zone": "Z1", "slot": "09-11", "capacityOrders": 10, "booked": 10, "available": 0 }, { "zone": "Z1", "slot": "11-13", "capacityOrders": 10, "booked": 0, "available": 10 } ], "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Usable minutes = slot length × (1 − buffer) − stem; orders/vehicle = floor(usable/(service+drive)).", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/geofence-check $0.02 USDC. Test points against GeoJSON service zones with holes, reporting inside/in-hole status and nearest boundary distance. Inputs: zones, points Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-geofence-check Example request: ```json { "zones": { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "id": "zone1" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 0, 0 ], [ 0, 1 ], [ 1, 1 ], [ 1, 0 ], [ 0, 0 ] ], [ [ 0.4, 0.4 ], [ 0.4, 0.6 ], [ 0.6, 0.6 ], [ 0.6, 0.4 ], [ 0.4, 0.4 ] ] ] } } ] }, "points": [ { "id": "p1", "lon": 0.2, "lat": 0.2 }, { "id": "p2", "lon": 0.5, "lat": 0.5 }, { "id": "p3", "lon": 1.5, "lat": 0.5 } ] } ``` Example response: ```json { "results": [ { "point": "p1", "inside": [ "zone1" ], "nearestBoundaryM": 22238.88 }, { "point": "p2", "inside": [], "inHoleOf": [ "zone1" ], "nearestZone": "zone1", "nearestBoundaryM": 11119.08 }, "…" ], "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "GeoJSON RFC 7946 point-in-polygon (even-odd) with holes; boundary distance uses great-circle cross-track formulas.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ``` ### POST /api/v1/route-optimization/polyline-codec $0.01 USDC. Encode or decode Google Encoded Polyline strings and optionally simplify with Douglas-Peucker. Inputs: encode?, decode?, precision?, simplify? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-polyline-codec Example request: ```json { "encode": [ [ 38.5, -120.2 ], [ 40.7, -120.95 ], [ 43.252, -126.453 ] ], "decode": null, "precision": 5, "simplify": null } ``` Example response: ```json { "encoded": "_p~iF~ps|U_ulLnnqC_mqNvxq`@", "points": 3, "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Encoded Polyline Algorithm Format (Google), documentation under CC BY 4.0; algorithm only.", "Douglas-Peucker simplify uses planar tolerance in input units or local equirectangular metres.", "…" ] } ``` ### POST /api/v1/route-optimization/route-plan-validate $0.02 USDC. Check a manual plan for time-window, capacity, shift, precedence and duplicate/missing-stop violations. Inputs: depot?, stops, vehicles, plan, requests?, matrix?, matrixFromPoints?, speed?, requireAllStops? Docs: https://www.brainiac.software/api/route-optimization/docs#route-optimization-route-plan-validate Example request: ```json { "depot": { "id": "depot", "x": 0, "y": 0, "window": [ 0, 100 ] }, "stops": [ { "id": "a", "x": 2, "y": 6, "window": [ 25, 40 ], "service": 2 }, { "id": "b", "x": 5, "y": 2, "window": [ 0, 10 ], "service": 2 }, { "id": "c", "x": 6, "y": 6, "window": [ 15, 30 ], "service": 2 }, { "id": "d", "x": 8, "y": 3, "window": [ 5, 20 ], "service": 2 }, { "id": "e", "x": 1, "y": 3, "window": [ 35, 50 ], "service": 2 } ], "vehicles": [ { "id": "v1", "shift": [ 0, 100 ] } ], "plan": [ { "vehicle": "v1", "sequence": [ "b", "d", "a", "c", "e" ] } ], "matrixFromPoints": "euclidean", "speed": 1, "requireAllStops": true } ``` Example response: ```json { "valid": false, "violations": [ { "vehicle": "v1", "stopIndex": 3, "stop": "c", "type": "time_window", "detail": "arrival 31.0000 > latest 30" } ], "missing": [], "duplicates": [], "sources": [ { "source": "Caller-supplied coordinates or distance/duration matrices processed locally", "url": "https://www.brainiac.software/api/v1/route-optimization", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Validates time windows, capacity, shift, precedence and duplicate/missing stops on a manual plan.", "Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity det…", "…" ] } ```