Solve
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/solveimport requests
url = "https://win.oneshotagent.com/v1/tools/solve"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/solve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://win.oneshotagent.com/v1/tools/solve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/tools/solve"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/tools/solve")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/solve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyTools
Solve
Plan vehicle routes with capacity and time windows, returning constraint checks and conflicts.
POST
/
v1
/
tools
/
solve
Solve
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/solveimport requests
url = "https://win.oneshotagent.com/v1/tools/solve"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/solve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://win.oneshotagent.com/v1/tools/solve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/tools/solve"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/tools/solve")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/solve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodySolve 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.
{
"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]] }
}
}