Fleet optimization
POST /optimize with two or more vehicles is billed as fleet optimization. For one vehicle see Single-vehicle.
Request
Section titled “Request”curl https://api.argamin.ai/v1/optimize \ -H "Authorization: Bearer am_test_..." \ -H "Content-Type: application/json" \ -d '{ "vehicles": [ { "id": "van-1", "start": { "lat": 51.5072, "lng": -0.1276 }, "end": { "lat": 51.5072, "lng": -0.1276 }, "capacity": [ 20 ], "skills": [ "fridge" ], "time_window": { "start": "2026-11-26T08:00:00Z", "end": "2026-11-26T17:00:00Z" } }, { "id": "van-2", "start": { "lat": 51.5072, "lng": -0.1276 }, "capacity": [ 20 ], "time_window": { "start": "2026-11-26T08:00:00Z", "end": "2026-11-26T17:00:00Z" } } ], "jobs": [ { "id": "order-1001", "location": { "lat": 51.5155, "lng": -0.0922 }, "service": 300, "delivery": [ 2 ] }, { "id": "order-1002", "location": { "lat": 51.4613, "lng": -0.1156 }, "service": 300, "delivery": [ 1 ], "time_windows": [ { "start": "2026-11-26T09:00:00Z", "end": "2026-11-26T11:00:00Z" } ] }, { "id": "order-1003", "location": { "lat": 51.539, "lng": -0.1426 }, "service": 180, "delivery": [ 4 ], "skills": [ "fridge" ] }, { "id": "order-1004", "location": { "lat": 51.4934, "lng": -0.0098 }, "service": 240, "delivery": [ 1 ], "priority": 50 } ], "shipments": [ { "amount": [ 1 ], "pickup": { "id": "ret-7-pick", "location": { "lat": 51.5226, "lng": -0.1571 }, "service": 120 }, "delivery": { "id": "ret-7-drop", "location": { "lat": 51.5033, "lng": -0.1196 }, "service": 120 } } ], "options": { "geometry": false }}'| Field | What it does |
|---|---|
vehicles[] |
id, start and optional end (lat, lng), capacity, time_window, skills, breaks |
jobs[] |
One stop: id, location, service (seconds), delivery or pickup, time_windows, skills, priority |
shipments[] |
A pickup and its delivery served by the same vehicle (pickup, delivery, amount). Counts as 2 stops |
The API reference lists every field.
Response
Section titled “Response”{ "summary": { "routes": 2, "unassigned": 0, "duration": 5120, "distance": 41230, "service": 1260, "waiting_time": 0, "cost": 5120 }, "routes": [ { "vehicle_id": "van-1", "duration": 2210, "distance": 17840, "service": 480, "waiting_time": 0, "steps": [ { "type": "start", "location": { "lat": 51.5072, "lng": -0.1276 }, "arrival": "2026-11-26T08:00:00Z", "arrival_offset": 0, "duration": 0, "distance": 0, "load": [ 6 ] }, { "type": "job", "id": "order-1003", "location": { "lat": 51.539, "lng": -0.1426 }, "arrival": "2026-11-26T08:14:10Z", "arrival_offset": 850, "duration": 850, "distance": 6120, "service": 180, "waiting_time": 0, "load": [ 2 ] }, { "type": "job", "id": "order-1001", "location": { "lat": 51.5155, "lng": -0.0922 }, "arrival": "2026-11-26T08:32:20Z", "arrival_offset": 1940, "duration": 1760, "distance": 13950, "service": 300, "waiting_time": 0, "load": [ 0 ] }, { "type": "end", "location": { "lat": 51.5072, "lng": -0.1276 }, "arrival": "2026-11-26T08:44:50Z", "arrival_offset": 2690, "duration": 2210, "distance": 17840, "load": [ 0 ] } ] }, { "vehicle_id": "van-2", "duration": 2910, "distance": 23390, "service": 780, "waiting_time": 0, "steps": [ { "type": "start", "location": { "lat": 51.5072, "lng": -0.1276 }, "arrival": "2026-11-26T08:00:00Z", "arrival_offset": 0, "duration": 0, "distance": 0, "load": [ 2 ] }, { "type": "pickup", "id": "ret-7-pick", "location": { "lat": 51.5226, "lng": -0.1571 }, "arrival": "2026-11-26T08:09:00Z", "arrival_offset": 540, "duration": 540, "distance": 3100, "service": 120, "waiting_time": 0, "load": [ 3 ] }, { "type": "delivery", "id": "ret-7-drop", "location": { "lat": 51.5033, "lng": -0.1196 }, "arrival": "2026-11-26T08:20:00Z", "arrival_offset": 1200, "duration": 1080, "distance": 6900, "service": 120, "waiting_time": 0, "load": [ 2 ] }, { "type": "job", "id": "order-1002", "location": { "lat": 51.4613, "lng": -0.1156 }, "arrival": "2026-11-26T09:00:00Z", "arrival_offset": 3600, "duration": 1810, "distance": 12400, "service": 300, "waiting_time": 0, "load": [ 1 ] }, { "type": "job", "id": "order-1004", "location": { "lat": 51.4934, "lng": -0.0098 }, "arrival": "2026-11-26T09:22:30Z", "arrival_offset": 4950, "duration": 2910, "distance": 23390, "service": 240, "waiting_time": 0, "load": [ 0 ] } ] } ], "unassigned": [], "request_id": "req_2b9d6f1e0c8a4e7f9a3b5c7d1e2f4a6b"}Jobs and shipments that cannot be served inside the constraints come back in unassigned, each with a reason.
Size and background jobs
Section titled “Size and background jobs”Synchronous requests are limited (see Limits and pricing). For larger problems create a job at POST /optimize/jobs. You get 202 with a job id and links. Receive a webhook or poll GET /optimize/jobs/{id}. Cancel with DELETE: cancelling before the solve starts is free.
Billing
Section titled “Billing”Per stop, only on success. Every pickup and every delivery counts as a stop.
| Service | Unit | Free / month | 0 - 100K | 100K - 500K | 500K - 1M | 1M - 5M | 5M+ |
|---|---|---|---|---|---|---|---|
| Fleet optimization | stop | 1,000 | $10.00 | $5.00 | $2.00 | $0.80 | $0.70 |
- Give every stop a realistic
service. Plans look better and arrival times are closer to what happens. - Keep time windows as wide as the business allows. Very narrow windows leave stops unassigned.
- The engine plans on road-network speeds. There is no live traffic.