# magent CDAI Calculator

> magent CDAI 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-13).

Computes the 1976 Best Crohn's Disease Activity Index (CDAI) as a rounded integer from eight weighted clinical variables

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/cdai
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/magent-cdai-calculator-42d70ead
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hH2uwh8j2fENnjEc5BMs1

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-cdai-calculator-42d70ead
```

Example prompt: Calculate the Best 1976 CDAI for a male patient with 18 liquid stools over 7 days, an abdominal pain sum of 10, well-being sum of 14, 2 extra-intestinal manifestations, not taking antidiarrheal meds, no abdominal mass (grade 0), hematocrit of 40%, and weight 5% below ideal.

## When to prefer this

Use this endpoint when you need the original 1976 Best eight-variable CDAI score — especially for clinical research, trial eligibility checks, or longitudinal monitoring where the canonical formula matters. Do not use it if you need the simpler Harvey-Bradshaw Index (one-day, five-variable), if you need an interpreted severity band rather than a raw score, or if the patient's physical exam data (abdominal mass, weight) are unavailable.

## Known failure modes

- Missing required query parameters returns an error
- abdominal_mass values other than 0, 2, or 5 are invalid
- hematocrit_percent outside 10–70 range rejected
- liquid_stool_count_7d or pain/wellbeing sums out of valid integer ranges rejected
- Invalid sex string (must be 'male' or 'female') causes error
- Payment not included or insufficient USDC results in 402 response

## How this service works

Best 1976 Crohn's disease activity index (CDAI): eight weighted variables (7-day liquid stools *2, abdominal-pain sum *5, well-being sum *7, extra-intestinal count *20, antidiarrheal *30, abdominal mass 0/2/5 *10, hematocrit deficit *6, caller-assigned weight-percent deviation). magent returns the rounded integer index only and does not apply later trial activity bands. magent does not examine the patient. Not a Crohn's diagnosis and not the Harvey-Bradshaw one-day index.

## Output

A single rounded integer representing the Crohn's Disease Activity Index per the Best 1976 formula. Scores below 150 generally indicate remission; 150–220 mild; 220–450 moderate; above 450 severe — but the endpoint itself returns only the raw integer and does not label activity bands.

## 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": [
      "sex",
      "liquid_stool_count_7d",
      "abdominal_pain_sum_7d",
      "wellbeing_sum_7d",
      "extra_intestinal_count",
      "taking_antidiarrheal",
      "abdominal_mass",
      "hematocrit_percent",
      "weight_percent_deviation"
     ],
     "properties": {
      "sex": {
       "type": "string",
       "description": "male or female. Best 1976 hematocrit standard is 47 (male) or 42 (female). magent does not examine the patient."
      },
      "abdominal_mass": {
       "type": "integer",
       "description": "Caller-assigned Best 1976 abdominal mass (exactly 0 none, 2 questionable, or 5 definite; ×10). Not 1, 3, or 4. magent does not examine the patient."
      },
      "wellbeing_sum_7d": {
       "type": "integer",
       "description": "Sum of daily Best 1976 general well-being ratings over 7 days (integer 0-28; each day 0 generally well, 1 slightly below par, 2 poor, 3 very poor, 4 terrible; ×7). magent does not examine the patient."
      },
      "hematocrit_percent": {
       "type": "number",
       "description": "Hematocrit in percent (10-70). Best 1976 uses a whole-number hematocrit. Deficit is 47 minus this value (male) or 42 minus this value (female), then ×6; may be negative if above the sex standard. magent does not assay hematocrit."
      },
      "taking_antidiarrheal": {
       "type": "boolean",
       "description": "Taking diphenoxylate/atropine (Lomotil) or opiates for diarrhea as in Best 1976. true or false. true scores 30. magent does not examine the patient."
      },
      "abdominal_pain_sum_7d": {
       "type": "integer",
       "description": "Sum of daily Best 1976 abdominal-pain ratings over 7 days (integer 0-21; each day 0 none, 1 mild, 2 moderate, 3 severe; ×5). magent does not examine the patient."
      },
      "liquid_stool_count_7d": {
       "type": "integer",
       "description": "Sum of liquid or very soft stools over 7 days (Be
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/magent-cdai-calculator-42d70ead/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)
