← back to demo

SlotSolver API

One endpoint: POST /v1/solve. Send jobs and resources, get back a feasible schedule in under 2 seconds. Hard constraints only (skills, job time windows, resource shifts). Objective: maximize priority-weighted assigned jobs, tie-break minimize makespan.

Auth

Static API key, either header works:

Authorization: Bearer <your-api-key>
X-API-Key: <your-api-key>

Every successful solve increments a per-key counter (the billing meter: $0.02/solve). Check your usage at GET /v1/usage.

Request

curl -s https://YOUR-HOST/v1/solve \
  -H "Authorization: Bearer demo-key-12345" \
  -H "Content-Type: application/json" \
  -d '{
  "jobs": [
    {"id": "j1", "duration_min": 45, "window": ["09:00","13:00"], "required_skill": "hvac", "priority": 3}
  ],
  "resources": [
    {"id": "r1", "skills": ["hvac"], "shift": ["08:00","17:00"]}
  ],
  "options": {"time_budget_ms": 2000}
}'

Response

{
  "assignments": [
    {"job_id": "j1", "resource_id": "r1", "start": "09:00", "end": "09:45"}
  ],
  "unassigned": [
    {"job_id": "j9", "reason": "no_skilled_resource_in_window"}
  ],
  "objective": {"assigned": 48, "priority_weighted": 131, "makespan_min": 465}
}

Fields

fieldmeaning
jobs[].window[start, end] as "HH:MM", the job must run fully inside this window
resources[].shift[start, end] as "HH:MM", when the resource is available
options.time_budget_mswall-clock cap for local search, default and max 2000ms
unassigned[].reasonno_skilled_resource_in_window (no eligible resource/window overlap) or resource_fully_booked (eligible resource exists but every slot is taken by a higher-priority job)

Limits

Errors

{
  "error": "invalid request",
  "details": ["jobs[0].window: window is shorter than duration_min, job can never be feasibly scheduled"]
}