# OR-Tools CP-SAT Schedule Solver

> OR-Tools CP-SAT Schedule Solver is a paid API for AI agents from x402-api-24223879872.us-east1.run.app, paid per call via x402, $0.3/call, status unknown (last checked 2026-10-11).

Solves scheduling and roster assignment problems using Google OR-Tools CP-SAT, assigning resources to time slots while honoring availability, tags, and constraints, with configurable optimization objectives.

## Facts

- Endpoint: POST https://x402-api-24223879872.us-east1.run.app/v1/schedule-solve?utm_source=zero.xyz
- Price: $0.3/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/or-tools-cp-sat-schedule-solver-017dfb9d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Gl3Hjf2i0pbHvQKuHoE3D

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability or-tools-cp-sat-schedule-solver-017dfb9d -d '<json body>'
```

Example prompt: I need to schedule 12 yoga instructors across 20 class slots this week — can you solve the roster using OR-Tools, balancing the load evenly, making sure no instructor is double-booked, each works at most 6 hours total, and that instructors tagged 'advanced' are only assigned to advanced-level slots?

## When to prefer this

Choose this endpoint when you need to solve a real scheduling or rostering problem with multiple constraints (availability, tags, no double-booking, rest periods, required/forbidden pairings, fixed assignments, hour caps) and want an optimal or feasible assignment back in seconds. It is especially useful when you need to know exactly which constraints make a problem infeasible. Prefer it over manual heuristics or general-purpose LLM reasoning when the problem has more than a handful of resources and slots, or when constraint violations need to be formally detected.

## Known failure modes

- Infeasible input: returns named conflicting demands/constraints instead of an assignment
- Time limit exceeded: solver returns best partial solution or infeasibility signal within timeLimitSeconds
- Invalid schema: missing required slots, demands, or resources fields causes a 400-level error
- Contradictory constraints (e.g. require_pair and forbid_pair for same pair): flagged as conflict
- Resources with no overlapping availability with any slot result in unassigned demands

## How this service works

Solves a scheduling/roster problem (gym class rosters, dance-school timetables, restaurant shift plans) with OR-Tools CP-SAT: assigns resources to slot demands honoring availability, tags, and constraints (no double-booking, max-per-day, min-rest, forbidden/required pairs, fixed assignments, max total hours), optimizing the requested objective. Infeasible inputs come back with the specific conflicting demands/constraints named.

## Output

Returns a solved schedule with resource-to-slot assignments satisfying all constraints, along with the optimization objective value. If the problem is infeasible, returns specific conflicting demands and constraints by name so the caller can identify and resolve them. Solve time is bounded by the configured timeLimitSeconds (default 5, max 15).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "slots": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "Time or label slots demands can be assigned to."
  },
  "demands": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "Assignment requirements, each tied to a slot."
  },
  "objective": {
   "enum": [
    "balance_load",
    "maximize_preferences",
    "minimize_resources"
   ],
   "type": "string",
   "default": "balance_load"
  },
  "resources": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "People/rooms/equipment that can be assigned, with tags and availability."
  },
  "constraints": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "Optional typed constraints: no_double_booking, max_per_day, min_rest_between, forbid_pair, require_pair, fixed_assignment, max_total_hours."
  },
  "timeLimitSeconds": {
   "type": "number",
   "default": 5,
   "maximum": 15
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/or-tools-cp-sat-schedule-solver-017dfb9d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-api-24223879872.us-east1.run.app](https://www.zero.xyz/host/x402-api-24223879872.us-east1.run.app/llms.txt)
