# magent BAWS Calculator

> magent BAWS Calculator is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Computes the Brief Alcohol Withdrawal Scale (BAWS) total score (0–15) from five caller-supplied symptom integers and flags whether the score predicts clinically significant withdrawal (CIWA-Ar ≥8).

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/baws
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/magent-baws-calculator-c6ccf1de
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MYx2cUsd8-7QxrYMjW36X

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability magent-baws-calculator-c6ccf1de
```

Example prompt: Calculate the BAWS score for a patient with tremor 2, diaphoresis 1, agitation 2, orientation 1, and hallucinations 0 — does it predict significant alcohol withdrawal?

## When to prefer this

Use this endpoint when you need a fast, automated computation of the Rastegar 2017 Brief Alcohol Withdrawal Scale from pre-assessed symptom integers in clinical decision-support or triage workflows. It is appropriate when a human clinician has already observed and scored the five BAWS items and needs the arithmetic sum and threshold interpretation. Prefer this over manual calculation in high-volume ED or admission pipelines where BAWS is the selected withdrawal screening instrument.

## Known failure modes

- Missing required query parameters (tremor, diaphoresis, agitation, orientation, or hallucinations) returns a 400 or validation error
- Non-integer or out-of-range values (e.g. 4, -1, or decimals) for any component will fail schema validation
- Payment not included or invalid x402 token results in a 402 Payment Required response
- Server-side error returns 5xx with no score

## How this service works

Rastegar 2017 Brief Alcohol Withdrawal Scale (BAWS): five caller-assigned integers 0-3 (tremor, diaphoresis, agitation, orientation, hallucinations), summed 0-15. BAWS >=3 predicted CIWA-Ar >=8 in that paper (sensitivity 85.3%, specificity 65.8%). magent does not examine the patient or order benzodiazepines. Not later ICU dose bands. Not a medical device.

## Output

Returns the BAWS total integer score (sum of five symptom components, range 0–15) and a boolean or flag indicating whether the score meets the Rastegar 2017 threshold (≥3) that predicted CIWA-Ar ≥8 with 85.3% sensitivity and 65.8% specificity. Does not include treatment recommendations or benzodiazepine dosing.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "tremor",
      "diaphoresis",
      "agitation",
      "orientation",
      "hallucinations"
     ],
     "properties": {
      "tremor": {
       "type": "integer",
       "description": "Caller-assigned Rastegar 2017 BAWS tremor points (integer 0-3). magent does not examine the patient."
      },
      "agitation": {
       "type": "integer",
       "description": "Caller-assigned Rastegar 2017 BAWS agitation points (integer 0-3). magent does not examine the patient."
      },
      "diaphoresis": {
       "type": "integer",
       "description": "Caller-assigned Rastegar 2017 BAWS diaphoresis (sweats) points (integer 0-3). magent does not examine the patient."
      },
      "orientation": {
       "type": "integer",
       "description": "Caller-assigned Rastegar 2017 BAWS confusion/orientation points (integer 0-3). magent does not examine the patient."
      },
      "hallucinations": {
       "type": "integer",
       "description": "Caller-assigned Rastegar 2017 BAWS hallucinations points (integer 0-3). One item, not separate CIWA-Ar tactile/auditory/visual scores. magent does not examine the patient."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/magent-baws-calculator-c6ccf1de/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
