Assign routes to drivers API

Assign pre-built routes to drivers by shift, skills and vehicle type with min-cost Hungarian matching.

The Assign routes to drivers operation is part of the Route Optimisation TSP VRP Delivery API on BRAINIAC.software. Assign pre-built routes to drivers by shift, skills and vehicle type with min-cost Hungarian matching. It is exposed as POST /api/v1/route-optimization/driver-shift-assign and priced at $0.03 USDC on Base. Payment uses the x402 exact scheme: an unpaid call returns HTTP 402 with payment requirements; after paying the exact USDC amount, retry the same request with a payment-signature header and Idempotency-Key. No account and no API key are required. Data sources for this product: Caller-supplied coordinates or distance/duration matrices processed locally Haversine on IUGG mean radius 6,371,008.8 m; Google Encoded Polyline Algorithm Format (CC BY 4.0 docs, algorithm only) Held-Karp, Clarke-Wright, Solomon I1, k-means++, p-median / Teitz-Bart, Hungarian assignment Limitations: Pure computation on caller input: no maps, routing, geocoding or network request at request time. Without a caller matrix, distances use haversine × circuity and are labelled estimate: true (not road distances). Solvers are exact on small instances and heuristic beyond documented caps; responses state method and whether optimality is proven. Outputs are route and delivery calculations for human review. They are not legal, customs, tax, medical or identity determinations. Caps: 2,000 stops, 100 vehicles; timeLimitMs default 2,000 (max 25,000). Outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Related operations in this group include Great-circle distance and duration matrix, Travelling salesman route order, Capacitated vehicle routing, Vehicle routing with time windows. Open the group documentation for the full request schema, field notes, and response examples before integrating.

POST$0.03 USDC
/api/v1/route-optimization/driver-shift-assign

Example request

curl -i -X POST "https://www.brainiac.software/api/v1/route-optimization/driver-shift-assign" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'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"
}
JSON

An unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.

FAQ

  • Do I need an API key? No. Pay the listed USDC amount with x402.
  • What network? Base (eip155:8453), USDC.
  • Is this an official determination? No. Results are for human review against the cited sources.

Related APIs

Route Optimisation TSP VRP Delivery APIFull docsHow it works