# Krebs 2009 PEG Score Calculator

> Krebs 2009 PEG Score 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 unweighted mean PEG score (0–10, one decimal) from three caller-supplied integer ratings for pain average, enjoyment-of-life interference, and general-activity interference, per Krebs 2009.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/peg
- 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/krebs-2009-peg-score-calculator-119a0c48
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bw3vf0__0VPN4UGT5p5wv

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 krebs-2009-peg-score-calculator-119a0c48
```

Example prompt: Calculate the Krebs 2009 PEG score for a patient whose pain average last week was 6, enjoyment-of-life interference was 5, and general-activity interference was 7.

## When to prefer this

Use this endpoint when you need a fast, deterministic computation of the Krebs 2009 PEG composite from three already-collected integer ratings and do not need severity banding, diagnostic interpretation, or the full Brief Pain Inventory. Prefer it over manual arithmetic when integrating PEG scoring into automated clinical workflows or research pipelines.

## Known failure modes

- Non-integer or out-of-range values (outside 0–10) will cause a validation error
- Missing any of the three required query parameters returns an error
- HTTP 402 payment required if x402 payment header is absent or insufficient
- Caller-supplied values that do not reflect actual patient responses will silently produce a mathematically correct but clinically meaningless score

## How this service works

Krebs 2009 PEG from three caller-assigned integers 0-10 (pain_average, enjoyment_of_life, general_activity). Unweighted mean (range 0-10, one decimal). magent does not interview the patient. Krebs 2009 published no diagnostic cutoff; magent does not invent mild, moderate, or severe bands. Not a pain diagnosis, opioid order, or the full Brief Pain Inventory.

## Output

Returns a single numeric PEG score — the unweighted arithmetic mean of pain_average, enjoyment_of_life, and general_activity — expressed to one decimal place on a 0–10 scale. No diagnostic bands, severity labels, or clinical recommendations are included.

## 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": [
      "pain_average",
      "enjoyment_of_life",
      "general_activity"
     ],
     "properties": {
      "pain_average": {
       "type": "integer",
       "description": "Caller-assigned Krebs 2009 PEG item (integer 0-10): \"What number best describes your pain on average in the past week?\" 0 = no pain, 10 = pain as bad as you can imagine. magent does not interview the patient."
      },
      "general_activity": {
       "type": "integer",
       "description": "Caller-assigned Krebs 2009 PEG interference with general activity in the past week (integer 0-10). 0 = does not interfere, 10 = completely interferes. magent does not interview the patient."
      },
      "enjoyment_of_life": {
       "type": "integer",
       "description": "Caller-assigned Krebs 2009 PEG interference with enjoyment of life in the past week (integer 0-10). 0 = does not interfere, 10 = completely interferes. magent does not interview 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/krebs-2009-peg-score-calculator-119a0c48/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)
