WEDGE
BMI
Deterministic Keys/Quetelet BMI from height and weight. Not a diagnosis.
When to use
Body-mass index from height and weight (Keys/Quetelet). Use for GLP-1 and bariatric prior-auth arithmetic. Deterministic published index with citation; not a diagnosis.
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/bmi?height_cm=170&weight_kg=70
Full URL: https://api.magentlab.com/api/calc/bmi?height_cm=170&weight_kg=70
Request
GET
/api/calc/bmi · x402 V2 · USDC on Base · $0.005 USDC
x402 V2 curl
Expect HTTP 402 and a PAYMENT-REQUIRED
header until you retry with PAYMENT-SIGNATURE.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/bmi?height_cm=170&weight_kg=70"
Cursor mcp.json
Intended config for @magent/mcp. This is not npm @x402/fetch
(a payment fetch wrapper).
{
"mcpServers": {
"magent": {
"args": [
"-y",
"@magent/mcp"
],
"command": "npx",
"env": {
"X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY"
}
}
}
}
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
height_cm |
number | optional | Height in centimeters. Provide height_cm or height_in. |
weight_kg |
number | optional | Weight in kilograms. Provide weight_kg or weight_lb. |
height_in |
number | optional | Height in inches. Converted as cm = in * 2.54. |
weight_lb |
number | optional | Weight in pounds. Converted as kg = lb * 0.45359237. |
Success fields
| Field | Type | Description |
|---|---|---|
formula |
string | bmi |
formula_expression |
string | Exact expression used |
height_cm |
number | Normalized height in cm |
weight_kg |
number | Normalized weight in kg |
bmi |
number | kg/m^2, 1 decimal place |
who_adult_category |
string | WHO adult cut-point label: underweight (<18.5), normal (18.5-24.9), overweight (25-29.9), obesity (>=30). Not a diagnosis. |
citation |
object | Keys 1972 citation |
disclaimer |
string | Not-a-device notice |
Example
Frozen fixture. Not a live lookup.
{
"disclaimer": "Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Keys A, Fidanza F, Karvonen MJ, Kimura N, Taylor HL",
"doi": "10.1016/0021-9681(72)90027-6",
"id": "keys-1972",
"source": "J Chronic Dis. 1972;25(6):329-343",
"title": "Indices of relative weight and obesity"
},
"formula": "bmi",
"formula_expression": "BMI = weight_kg / (height_m ^ 2)",
"weight_kg": 70.0,
"height_cm": 170.0,
"bmi": 24.2,
"who_adult_category": "normal"
}
Payment
Unpaid requests return HTTP 402 with a base64 PAYMENT-REQUIRED
header. Retry the same URL with PAYMENT-SIGNATURE. Settlement completes before the
tool runs. Full handshake and shared payment errors: Payments.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_height |
height_cm (50-250) or height_in (20-98) is required |
| 400 | invalid_weight |
weight_kg (1-500) or weight_lb (2-1100) is required |
| 402 | payment_required |
Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header |
| 409 | payment_in_progress |
The same authorization nonce is already being settled; retry shortly |
| 429 | rate_limited |
Too many requests from this client |
| 503 | settlement_uncertain |
Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE |
| 503 | facilitator_unavailable |
Payment facilitator unavailable |
| 503 | facilitator_misconfigured |
Payment facilitator is not configured |
| 503 | facilitator_unauthorized |
Payment facilitator rejected credentials |
| 503 | ledger_unavailable |
Payment ledger unavailable |
| 503 | payment_unavailable |
Payment processing unavailable |
Guarantees
- Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
- Lookups run on our nodes — no third-party data API wrappers.
- Localhost, IP literals, and metadata hostnames are rejected.
- Execution is timeout-bounded and concurrency-capped.