# BOPS (Behavioural Observational Pain Scale) Calculator

> BOPS (Behavioural Observational Pain Scale) 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 Hesselgard 2007 BOPS total score (0–6) by summing three caller-assigned integer items: facial expression, verbalization, and body position.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/bops
- 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/bops-behavioural-observational-pain-scale-calculator-103ff6b0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wPlJb7caKHjfg3UfPmS1G

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 bops-behavioural-observational-pain-scale-calculator-103ff6b0
```

Example prompt: Calculate the BOPS score for a child who is grimacing (facial expression 2), crying and screaming about pain (verbalization 2), and lying rigid with arms and legs drawn up (body position 2).

## When to prefer this

Use this endpoint when you need a fast, deterministic BOPS score per Hesselgard 2007 and you have already observed and rated the three subscores yourself. Prefer this over FLACC or Abbey when the clinical context specifically calls for BOPS. Do not use if you need automated observation, a pain diagnosis, or an analgesic recommendation.

## Known failure modes

- Missing required query parameter (facial_expression, verbalization, or body_position) returns an error
- Non-integer or out-of-range values (e.g. 3 or -1) cause a validation error
- Payment not included or insufficient USDC triggers a 402 Payment Required response

## How this service works

Hesselgard 2007 Behavioural Observational Pain Scale from three caller-assigned 0-2 items (facial_expression, verbalization, body_position) using that paper's 0/1/2 descriptors. magent sums only (max 6) and does not observe the child. No named analgesic cutoff. Not a pain diagnosis or analgesic order. Not FLACC. Not Abbey.

## Output

Returns a numeric BOPS total score between 0 and 6, computed as the arithmetic sum of the three caller-supplied subscores (facial_expression + verbalization + body_position). No analgesic cutoff, diagnosis, or treatment recommendation is 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": [
      "facial_expression",
      "verbalization",
      "body_position"
     ],
     "properties": {
      "body_position": {
       "type": "integer",
       "description": "Caller-assigned Hesselgard 2007 BOPS body position (integer 0-2): 0 inactive, lying relaxed with all extremities or sitting/walking; 1 restless movements, shifting, and/or touching the wound area; 2 lying rigid and/or drawn up with arms and legs close to the body. magent does not observe the child."
      },
      "verbalization": {
       "type": "integer",
       "description": "Caller-assigned Hesselgard 2007 BOPS verbalization (integer 0-2): 0 normal conversation/laughing/crowing; 1 completely quiet, sobbing, and/or complaining not because of pain; 2 crying, screaming, and/or complaining about pain. magent does not observe the child."
      },
      "facial_expression": {
       "type": "integer",
       "description": "Caller-assigned Hesselgard 2007 BOPS facial expression (integer 0-2): 0 neutral/positive composed; 1 negative/concerned; 2 grimacing/distorted. magent does not observe the child."
      }
     }
    }
   },
   "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/bops-behavioural-observational-pain-scale-calculator-103ff6b0/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)
