16trust / 100

Margin Calculator

by Vextorium in Other

x402 APIFailing, checked 1 h ago

Pricing calculator: from any two of cost, price, margin or markup it computes the rest, profit per unit and total, and the price with VAT. Avoids the classic margin vs markup confusion.

POST https://api.vextorium.com/v1/margin-calculator

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
0.0%
Response time
- typical, - slowest 5%
Last check
1 h ago: Amount "0.003" is not in atomic token units
Next check
any minute now

How to call it

# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://api.vextorium.com/v1/margin-calculator' \
  -H 'content-type: application/json' \
  --data-raw '{"cost":10,"markup_pct":50,"units":100,"vat_pct":21}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.vextorium.com%2Fv1%2Fmargin-calculator
const res = await pay("https://api.vextorium.com/v1/margin-calculator", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: "{\"cost\":10,\"markup_pct\":50,\"units\":100,\"vat_pct\":21}",
});
console.log(await res.json());

Example input

{
  "cost": 10,
  "markup_pct": 50,
  "units": 100,
  "vat_pct": 21
}

Example output

{
  "cost": 10,
  "margin_pct": 33.333,
  "markup_pct": 50,
  "note": "Margin = profit / price. Markup = profit / cost. A 50% markup is only a 33.3% margin.",
  "price_with_vat": 18.15,
  "price_without_vat": 15,
  "total_profit": 500,
  "total_revenue_without_vat": 1500,
  "unit_profit": 5,
  "units": 100,
  "vat_pct": 21
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
1 h agoAmount "0.003" is not in atomic token units40283 ms$0.003
6 h agoAmount "0.003" is not in atomic token units402148 ms$0.003
10 h agoAmount "0.003" is not in atomic token units40283 ms$0.003
14 h agoAmount "0.003" is not in atomic token units40294 ms$0.003
19 h agoAmount "0.003" is not in atomic token units402131 ms$0.003
23 h agoAmount "0.003" is not in atomic token units402117 ms$0.003
27 h agoAmount "0.003" is not in atomic token units402201 ms$0.003
31 h agoAmount "0.003" is not in atomic token units402239 ms$0.003
34 h agoAmount "0.003" is not in atomic token units402234 ms$0.003
39 h agoAmount "0.003" is not in atomic token units402238 ms$0.003
42 h agoAmount "0.003" is not in atomic token units402230 ms$0.003
47 h agoAmount "0.003" is not in atomic token units40276 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40281 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40274 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40279 ms$0.003