> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Solve

> Plan vehicle routes with capacity and time windows, returning constraint checks and conflicts.

Solve currently accepts `problem: "routing"`. Supply `routing.vehicles`, `routing.stops` and an `objective` of `distance`, `time` or `vehicles`. Locations use either coordinates (`lat`, `lng`) or identifiers from a square travel matrix; do not mix them. Stops may specify demand, service time and arrival windows, and vehicles may specify capacity, start/end locations and shifts.

The first call returns a 402 quote based on problem size and the requested `time_limit_s` (default 30, maximum 300). Retry the same input with `X-Quote-ID`, payment and an `Idempotency-Key`. A paid call returns 202 with `request_id`; poll `GET /v1/requests/:id` for the result. Reusing the same idempotency key and input returns the original job.

The result contains `status`, `objective_value`, `bound`, `gap`, `solution`, `checks`, `conflicts` and `meta`. Routing returns `feasible`, `infeasible` or `timeout`; it does not claim a proven optimum. A timeout may carry a checked route found within the cap. `bound` and `gap` are `null` for routing. Every returned solution has constraint checks; an infeasible result explains the conflicts found.

More than 500 stops, an estimated model above 100,000 variables, or an excessive time cap returns a named input error before payment. Other problem types currently return `unsupported_problem`. Unknown fields, duplicate identifiers and invalid matrices are also refused before payment.

```json theme={null}
{
  "problem": "routing",
  "time_limit_s": 30,
  "routing": {
    "objective": "distance",
    "vehicles": [{ "id": "van", "capacity": 10, "start": { "id": "depot" } }],
    "stops": [{ "id": "delivery", "demand": 1, "location": { "id": "delivery" } }],
    "matrix": { "ids": ["depot", "delivery"], "distance": [[0, 1], [1, 0]] }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.