# magent AP Prediction (Jin 2018 Early Diagnosis Score)

> magent AP Prediction (Jin 2018 Early Diagnosis Score) 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-15).

Computes the Jin 2018 integer prediction score for early diagnosis of acute pancreatitis in patients with serum lipase ≥3× ULN, returning a total score and risk-threshold flags.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/ap_prediction
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/magent-ap-prediction-jin-2018-early-diagnosis-score-0ccecb0f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_K_upgbtyWQ_Y5bQifmy_W

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-ap-prediction-jin-2018-early-diagnosis-score-0ccecb0f
```

Example prompt: Run the Jin 2018 acute pancreatitis prediction score for a patient with 1 prior AP episode, cholelithiasis present, no abdominal surgery in the last 2 months, epigastric pain yes, worsening pain yes, pain duration less than 5 days, moderate pain severity (4-6/10), and serum lipase 15× ULN.

## When to prefer this

Use this endpoint when you need a structured, reproducible integer score for early acute pancreatitis diagnosis specifically following the Jin 2018 model in patients with serum lipase ≥3× ULN. Prefer this over BISAP (mortality-focused), Ranson (24/48h severity), or Glasgow-Imrie (severity) when the clinical goal is early ED diagnosis confirmation rather than severity stratification or mortality prediction. Choose this when you already have caller-assigned clinical variables and a confirmed lipase fold value and want a score plus threshold flags, not an imaging order or clinical examination.

## Known failure modes

- lipase_uln_fold below 3 returns invalid_ap_prediction — the model population requires confirmed lipase ≥3× ULN
- missing required query parameters return a 4xx error
- out-of-enum values for prior_ap_episodes, pain_severity, or pain_duration_days return validation errors
- network or service errors return 5xx; retry is safe as endpoint is idempotent
- payment failure (x402) if USDC balance is insufficient

## How this service works

Jin 2018 ED model for early diagnosis of acute pancreatitis when lipase is at least 3x ULN. Integer points: prior episodes 0/1/2/3/4, cholelithiasis +2, abdominal surgery in 2 months -2, epigastric pain +2, worsening pain +1, pain duration >=5 days -1, severity mild 0 / moderate +2 / severe +3, lipase fold +0/+1/+2. Score max 14; jin2018_high_ppv if score>=8; jin2024_accuracy_cut if score>=6. Not a diagnosis. Not an imaging order. Not Ranson, BISAP, or Glasgow-Imrie.

## Output

Returns the computed Jin 2018 integer total score (max 14) summed from all eight clinical parameters, plus boolean flags: jin2018_high_ppv (true if score ≥8) and jin2024_accuracy_cut (true if score ≥6). Returns an invalid_ap_prediction flag if lipase fold is below 3× ULN. Does not provide a diagnosis, imaging order, or treatment recommendation.

## 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": [
      "prior_ap_episodes",
      "cholelithiasis",
      "abdominal_surgery_2mo",
      "epigastric_pain",
      "worsening_pain",
      "pain_duration_days",
      "pain_severity",
      "lipase_uln_fold"
     ],
     "properties": {
      "pain_severity": {
       "enum": [
        "mild_0_3",
        "moderate_4_6",
        "severe_7_10"
       ],
       "type": "string",
       "description": "Caller-assigned pain-severity token (Jin 2018). mild_0_3 (0-3) scores 0; moderate_4_6 (4-6) scores +2; severe_7_10 (7-10) scores +3. magent does not assign a pain scale."
      },
      "cholelithiasis": {
       "type": "boolean",
       "description": "Caller-assigned cholelithiasis (Jin 2018). true scores +2; false scores 0. magent does not read imaging."
      },
      "worsening_pain": {
       "type": "boolean",
       "description": "Caller-assigned worsening pain (Jin 2018). true scores +1; false scores 0."
      },
      "epigastric_pain": {
       "type": "boolean",
       "description": "Caller-assigned epigastric pain (Jin 2018). true scores +2; false scores 0. magent does not examine the patient."
      },
      "lipase_uln_fold": {
       "type": "number",
       "description": "Serum lipase as a fold of the laboratory ULN. Population is lipase ≥3× ULN (Jin 2018). ≥3 and <10 scores 0; ≥10 and <20 scores +1; ≥20 scores +2. Below 3 is invalid_ap_prediction."
      },
      "prior_ap_episodes": {
       "enum": [
        "0",
        "1",
        "2",
        "3",
        "4_or_more"
       ],
       "type": "string",
       "description": "Caller-assigned prior acute-pancreatitis episode token (Jin 2018). 0 scores 0; 1 scores 1; 2 scores 2; 3 scores 3; 4_or_more scores 4. magent does not take a history."
      },
      "pain_duration_days": {
       "enum": [
        "lt_5",
        "gte_5"
       ],
       "type": "string",
       "description": "Caller-assigned pain-duration token (Jin 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/magent-ap-prediction-jin-2018-early-diagnosis-score-0ccecb0f/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)
