curl "https://api.fermat.example/v1/optimizations" \
-H "Authorization: Bearer $FERMAT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: plan-2026-09-23" \
-d @field-service.json
import { createClient, createOptimization } from "@fermat/sdk";
const client = createClient({ apiKey: process.env.FERMAT_API_KEY! });
// Technicians with skills, shifts, breaks and time windows.
const { data, error } = await createOptimization({ client, body: problem });
if (error) throw new Error(error.error.message);
for (const u of data.unassigned) console.log(u.id, u.blockingConstraints);
import os
from fermat import Fermat
fermat = Fermat(api_key=os.environ["FERMAT_API_KEY"])
# Technicians with skills, shifts, breaks and time windows.
result = fermat.create_optimization(problem)
for route in result["routes"]:
print(route["vehicleId"], len(route["trips"]))
for u in result["unassigned"]:
print("unassigned", u["id"], u["blockingConstraints"])
Request tracereq_01J8…Q4 · 1.84 s
validate28 ms
travel times · 71% cached352 ms
quick plan0.88 s
deep search · selected1.40 s
reasons + save64 ms
200 · 1.84 sresult.json
{
"status": "completed",
"region": "ethiopia",
"summary": { "vehiclesUsed": 2, "assigned": 11, "unassigned": 1,
"duration": 27840, "distance": 41210, "objective": 17960 },
"routes": [
{ "vehicleId": "tech-amanuel", "trips": [ … ], "cost": { … } },
{ "vehicleId": "tech-selam", "trips": [ … ], "cost": { … } }
],
"unassigned": [
{ "id": "wo-3107", "blockingConstraints": ["timeWindow"] }
],
"relaxation": [
{ "constraint": "timeWindow", "relaxBy": 1080, "wouldAssign": 1 }
],
"estimateSources": { "learned": 0.71, "predicted": 0.29 }
}