# PEN-FAST Penicillin Allergy Risk Calculator

> PEN-FAST Penicillin Allergy Risk 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 Trubiano 2020 PEN-FAST score (0–5) and risk category for patients with a reported penicillin allergy to guide allergy testing decisions.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/pen_fast
- 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/pen-fast-penicillin-allergy-risk-calculator-60c21fa3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_m78ZhTBePSQmwGFSfQaf6

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 pen-fast-penicillin-allergy-risk-calculator-60c21fa3
```

Example prompt: My patient has a reported penicillin allergy — the reaction was anaphylaxis that happened 3 years ago and treatment was required. Can you run the PEN-FAST score to see if they're low risk for penicillin allergy testing?

## When to prefer this

Use this endpoint when you need a fast, validated, structured PEN-FAST risk score for a patient with a reported penicillin allergy and you already have the three binary clinical flags (timing, phenotype severity, treatment required). It is purpose-built for the Trubiano 2020 instrument and returns a machine-readable risk category and testing recommendation flag, making it ideal for clinical decision support workflows, antimicrobial stewardship automation, or pre-prescription allergy screening pipelines.

## Known failure modes

- Missing required query parameters (five_or_fewer_years_ago, anaphylaxis_angioedema_or_scar, treatment_required) returns a 400 error
- Non-boolean values for boolean parameters cause validation errors
- Payment header missing or insufficient USDC balance returns 402 Payment Required
- Caller misclassifies allergy phenotype leading to incorrect score — the API trusts caller-assigned flags and does not validate clinical accuracy

## How this service works

Trubiano 2020 PEN-FAST for patients who already report a penicillin allergy. Three caller-assigned flags: allergy event 5 or fewer years ago (2), anaphylaxis/angioedema or potential SCAR as one criterion (2), treatment required (1). Max 5. Risk: 0 very_low, 1–2 low, 3 moderate, 4–5 high. low_risk_for_testing iff score < 3. Not an allergy diagnosis or delabeling order. magent does not take an allergy history.

## Output

Returns the total PEN-FAST score (integer 0–5), a risk category (very_low, low, moderate, or high), and a boolean low_risk_for_testing flag (true if score < 3), indicating whether the patient is a candidate for low-risk penicillin allergy evaluation per the Trubiano 2020 tool.

## 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": [
      "five_or_fewer_years_ago",
      "anaphylaxis_angioedema_or_scar",
      "treatment_required"
     ],
     "properties": {
      "treatment_required": {
       "type": "boolean",
       "description": "Treatment required for the allergy episode as assigned by the caller (Trubiano 2020). true scores 1. magent does not take an allergy history."
      },
      "five_or_fewer_years_ago": {
       "type": "boolean",
       "description": "Allergy event 5 or fewer years ago as assigned by the caller (Trubiano 2020). true scores 2. magent does not take an allergy history."
      },
      "anaphylaxis_angioedema_or_scar": {
       "type": "boolean",
       "description": "Anaphylaxis/angioedema or potential SCAR as one 2-point criterion (Trubiano 2020). true scores 2; do not add both phenotypes separately. magent does not take an allergy history."
      }
     }
    }
   },
   "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/pen-fast-penicillin-allergy-risk-calculator-60c21fa3/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)
