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
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 1 h ago | Amount "0.003" is not in atomic token units | 402 | 83 ms | $0.003 |
| 6 h ago | Amount "0.003" is not in atomic token units | 402 | 148 ms | $0.003 |
| 10 h ago | Amount "0.003" is not in atomic token units | 402 | 83 ms | $0.003 |
| 14 h ago | Amount "0.003" is not in atomic token units | 402 | 94 ms | $0.003 |
| 19 h ago | Amount "0.003" is not in atomic token units | 402 | 131 ms | $0.003 |
| 23 h ago | Amount "0.003" is not in atomic token units | 402 | 117 ms | $0.003 |
| 27 h ago | Amount "0.003" is not in atomic token units | 402 | 201 ms | $0.003 |
| 31 h ago | Amount "0.003" is not in atomic token units | 402 | 239 ms | $0.003 |
| 34 h ago | Amount "0.003" is not in atomic token units | 402 | 234 ms | $0.003 |
| 39 h ago | Amount "0.003" is not in atomic token units | 402 | 238 ms | $0.003 |
| 42 h ago | Amount "0.003" is not in atomic token units | 402 | 230 ms | $0.003 |
| 47 h ago | Amount "0.003" is not in atomic token units | 402 | 76 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 81 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 74 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 79 ms | $0.003 |