vrsai · Capabilities Decision Optimization

by vrsai

POSTBaseSolana

$0.03

per call · USD Coin on Base

Choose the lowest-cost or highest-value feasible allocation, assignment, selection, or resource mix from caller-supplied options, capacities, budgets, and eligibility rules, with independently verified feasibility evidence and solver optimality/gap information.

Endpoint

POST https://api.vrsai.tech/v1/capabilities/decision_optimization

3

Calls / 30d

2

Unique payers / 30d

Sep 3

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://api.vrsai.tech/v1/capabilities/decision_optimization", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "demands": [
      {
        "id": "warehouse_1",
        "requirement": "80",
        "satisfaction": "exact"
      }
    ],
    "lanes": [
      {
        "demand_id": "warehouse_1",
        "source_id": "supplier_a",
        "unit_cost": "2"
      },
      {
        "demand_id": "warehouse_1",
        "source_id": "supplier_b",
        "unit_cost": "5"
      }
    ],
    "objective": "minimize_total_cost",
    "problem_type": "allocation",
    "sources": [
      {
        "capacity": "100",
        "id": "supplier_a"
      },
      {
        "capacity": "100",
        "id": "supplier_b"
      }
    ]
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://api.vrsai.tech/v1/capabilities/decision_optimization" \
  -H "Content-Type: application/json" \
  -d '{"demands":[{"id":"warehouse_1","requirement":"80","satisfaction":"exact"}],"lanes":[{"demand_id":"warehouse_1","source_id":"supplier_a","unit_cost":"2"},{"demand_id":"warehouse_1","source_id":"supplier_b","unit_cost":"5"}],"objective":"minimize_total_cost","problem_type":"allocation","sources":[{"capacity":"100","id":"supplier_a"},{"capacity":"100","id":"supplier_b"}]}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "decision": {
    "lanes": [
      {
        "demand_id": "warehouse_1",
        "quantity": "80",
        "source_id": "supplier_a"
      },
      {
        "demand_id": "warehouse_1",
        "quantity": "0",
        "source_id": "supplier_b"
      }
    ],
    "problem_type": "allocation",
    "source_activations": [
      {
        "active": true,
        "source_id": "supplier_a"
      },
      {
        "active": false,
        "source_id": "supplier_b"
      }
    ]
  },
  "diagnostics": {
    "binding_constraints": []
  },
  "economics": {
    "objective": "minimize_total_cost",
    "objective_value": "160",
    "sense": "minimize"
  },
  "evidence": {
    "constraints_checked": 3,
    "constraints_violated": 0,
    "decision_fingerprint": "v1:43b9ac81c64b8f95e46837a5103ac13d8f27ad829b32ee06463079bf0be83b81",
    "input_fingerprint": "v1:23bf4e29934aad481275e4bf38cb45617bbbe664ad3dd5d771af2fe3d4d1c938",
    "model_fingerprint": "v1:392d8ab317c91b7339a92c2b9fa4b2b30f326f2175955d6fa362c4b57287c5a5",
    "ruleset_version": "decision_optimization_r1",
    "solver": "highs",
    "solver_version": "1.15.2"
  },
  "machine_action": "CONSUME_OPTIMAL_DECISION",
  "problem_type": "allocation",
  "quality": {
    "absolute_gap": "0",
    "best_bound": "160",
    "relative_gap": "0",
    "semantic_feasibility_verified": true,
    "solution_uniqueness": "unknown",
    "solver_optimality": "optimal_within_profile_tolerance"
  },
  "status": "OPTIMAL"
}

Payment details

Pay to0x6746dff7bdb1ed4940dbe50024795ad97cba09af
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana
Schemesexact

Is this your API?

Pin it to the top of AI & Inference and the homepage with a featured placement.

Get featured →

More from vrsai & similar services