MAGENT

Emergency · LIVE

COWS

Sum the eleven Wesson 2003 Clinical Opiate Withdrawal Scale (COWS) items from caller-assigned appendix integers and return the published total (max 48) with the published severity cutoffs.

LIVE $0.005 USDC GET /api/calc/cows

Markdown: /docs/cows.md · Canonical: https://magentlab.com/docs/cows

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Sum the eleven Wesson 2003 Clinical Opiate Withdrawal Scale (COWS) items from caller-assigned appendix integers and return the published total (max 48) with the published severity cutoffs.

When to use

When an agent has already assigned Wesson 2003 appendix integers for each COWS sign and needs the published total and severity, not a buprenorphine induction protocol.

When not to use

  • Not a diagnosis and not a buprenorphine, methadone, or other opioid-agonist induction or treatment protocol.
  • Items are caller-assigned Wesson 2003 appendix integers only. magent does not observe the patient.
  • Each sign accepts only the integers printed for that sign in the Wesson 2003 appendix (NIDA reprint of the same scale). Other integers return invalid_cows_item.
  • Published severity is 5-12 mild, 13-24 moderate, 25-36 moderately severe, and >36 severe. Scores 0-4 are below the published mild cutoff and return severity none; that is not a new clinical stage.

Formula

COWS = resting_pulse_rate + gi_upset + sweating + tremor + restlessness + yawning + pupil_size + anxiety_or_irritability + bone_or_joint_aches + gooseflesh_skin + runny_nose_or_tearing; Wesson 2003 appendix integers only; max 48

Citation

Title
The Clinical Opiate Withdrawal Scale (COWS)
Authors
Wesson DR, Ling W
Source
J Psychoactive Drugs. 2003;35(2):253-259
DOI
10.1080/02791072.2003.10400007

Worked example

All items 0

Given: anxiety_or_irritability=0bone_or_joint_aches=0gi_upset=0gooseflesh_skin=0pupil_size=0resting_pulse_rate=0restlessness=0runny_nose_or_tearing=0sweating=0tremor=0yawning=0

  1. resting_pulse_rate 0 + gi_upset 0 + sweating 0 + tremor 0 + restlessness 0 + yawning 0 + pupil_size 0 + anxiety_or_irritability 0 + bone_or_joint_aches 0 + gooseflesh_skin 0 + runny_nose_or_tearing 0
  2. Score = 0 (max 48); severity none (below published mild 5-12)

Every item at its printed maximum

Given: anxiety_or_irritability=4bone_or_joint_aches=4gi_upset=5gooseflesh_skin=5pupil_size=5resting_pulse_rate=4restlessness=5runny_nose_or_tearing=4sweating=4tremor=4yawning=4

  1. 4+5+4+4+5+4+5+4+4+5+4 = 48
  2. Score = 48 (max 48); severity severe (>36)

Also searched as

  • COWS
  • Clinical Opiate Withdrawal Scale
  • opioid withdrawal scale
  • Wesson COWS
  • opiate withdrawal score
  • COWS score
  • Clinical Opioid Withdrawal Scale

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/cows?resting_pulse_rate=0&gi_upset=0&sweating=0&tremor=0&restlessness=0&yawning=0&pupil_size=0&anxiety_or_irritability=0&bone_or_joint_aches=0&gooseflesh_skin=0&runny_nose_or_tearing=0

Full URL: https://api.magentlab.com/api/calc/cows?resting_pulse_rate=0&gi_upset=0&sweating=0&tremor=0&restlessness=0&yawning=0&pupil_size=0&anxiety_or_irritability=0&bone_or_joint_aches=0&gooseflesh_skin=0&runny_nose_or_tearing=0

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/cows?resting_pulse_rate=0&gi_upset=0&sweating=0&tremor=0&restlessness=0&yawning=0&pupil_size=0&anxiety_or_irritability=0&bone_or_joint_aches=0&gooseflesh_skin=0&runny_nose_or_tearing=0"

Parameters

Name Type Required Description
resting_pulse_rate integer required Caller-assigned Wesson 2003 resting pulse rate points (integer 0, 1, 2, or 4). magent does not observe the patient.
gi_upset integer required Caller-assigned Wesson 2003 GI upset points (integer 0, 1, 2, 3, or 5). magent does not observe the patient.
sweating integer required Caller-assigned Wesson 2003 sweating points (integer 0, 1, 2, 3, or 4). magent does not observe the patient.
tremor integer required Caller-assigned Wesson 2003 tremor points (integer 0, 1, 2, or 4). magent does not observe the patient.
restlessness integer required Caller-assigned Wesson 2003 restlessness points (integer 0, 1, 3, or 5). magent does not observe the patient.
yawning integer required Caller-assigned Wesson 2003 yawning points (integer 0, 1, 2, or 4). magent does not observe the patient.
pupil_size integer required Caller-assigned Wesson 2003 pupil size points (integer 0, 1, 2, or 5). magent does not observe the patient.
anxiety_or_irritability integer required Caller-assigned Wesson 2003 anxiety or irritability points (integer 0, 1, 2, or 4). magent does not observe the patient.
bone_or_joint_aches integer required Caller-assigned Wesson 2003 bone or joint aches points (integer 0, 1, 2, or 4). magent does not observe the patient.
gooseflesh_skin integer required Caller-assigned Wesson 2003 gooseflesh skin points (integer 0, 3, or 5). magent does not observe the patient.
runny_nose_or_tearing integer required Caller-assigned Wesson 2003 runny nose or tearing points (integer 0, 1, or 4). magent does not observe the patient.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/cows Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "anxiety_or_irritability": "0",
      "bone_or_joint_aches": "0",
      "gi_upset": "0",
      "gooseflesh_skin": "0",
      "pupil_size": "0",
      "resting_pulse_rate": "0",
      "restlessness": "0",
      "runny_nose_or_tearing": "0",
      "sweating": "0",
      "tremor": "0",
      "yawning": "0"
    },
    {
      "anxiety_or_irritability": "0",
      "bone_or_joint_aches": "0",
      "gi_upset": "0",
      "gooseflesh_skin": "0",
      "pupil_size": "0",
      "resting_pulse_rate": "0",
      "restlessness": "0",
      "runny_nose_or_tearing": "0",
      "sweating": "0",
      "tremor": "0",
      "yawning": "0"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/cows",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "resting_pulse_rate",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "gi_upset",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "sweating",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tremor",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "restlessness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "yawning",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pupil_size",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "anxiety_or_irritability",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "bone_or_joint_aches",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "gooseflesh_skin",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "runny_nose_or_tearing",
          "points": 0,
          "present": true
        }
      ],
      "severity": "none",
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Wesson DR, Ling W",
        "doi": "10.1080/02791072.2003.10400007",
        "id": "wesson-2003",
        "pmid": "12924748",
        "source": "J Psychoactive Drugs. 2003;35(2):253-259",
        "title": "The Clinical Opiate Withdrawal Scale (COWS)"
      },
      "formula": "cows",
      "formula_expression": "COWS = resting_pulse_rate + gi_upset + sweating + tremor + restlessness + yawning + pupil_size + anxiety_or_irritability + bone_or_joint_aches + gooseflesh_skin + runny_nose_or_tearing; Wesson 2003 appendix integers only; max 48",
      "max_score": 48,
      "score": 0
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "resting_pulse_rate",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "gi_upset",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "sweating",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tremor",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "restlessness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "yawning",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pupil_size",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "anxiety_or_irritability",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "bone_or_joint_aches",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "gooseflesh_skin",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "runny_nose_or_tearing",
          "points": 0,
          "present": true
        }
      ],
      "severity": "none",
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Wesson DR, Ling W",
        "doi": "10.1080/02791072.2003.10400007",
        "id": "wesson-2003",
        "pmid": "12924748",
        "source": "J Psychoactive Drugs. 2003;35(2):253-259",
        "title": "The Clinical Opiate Withdrawal Scale (COWS)"
      },
      "formula": "cows",
      "formula_expression": "COWS = resting_pulse_rate + gi_upset + sweating + tremor + restlessness + yawning + pupil_size + anxiety_or_irritability + bone_or_joint_aches + gooseflesh_skin + runny_nose_or_tearing; Wesson 2003 appendix integers only; max 48",
      "max_score": 48,
      "score": 0
    }
  ]
}

Response

Field Type Description
formula string cows
formula_expression string Exact expression used
score integer COWS points 0-48
max_score integer 48
severity string Wesson 2003 appendix: none (0-4, below mild), mild (5-12), moderate (13-24), moderately_severe (25-36), severe (>36)
components array Per-item caller-assigned points
citation object Wesson and Ling J Psychoactive Drugs 2003 citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "components": [
    {
      "value": 0,
      "factor": "resting_pulse_rate",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "gi_upset",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "sweating",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "tremor",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "restlessness",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "yawning",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "pupil_size",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "anxiety_or_irritability",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "bone_or_joint_aches",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "gooseflesh_skin",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "runny_nose_or_tearing",
      "points": 0,
      "present": true
    }
  ],
  "severity": "none",
  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "Wesson DR, Ling W",
    "doi": "10.1080/02791072.2003.10400007",
    "id": "wesson-2003",
    "pmid": "12924748",
    "source": "J Psychoactive Drugs. 2003;35(2):253-259",
    "title": "The Clinical Opiate Withdrawal Scale (COWS)"
  },
  "formula": "cows",
  "formula_expression": "COWS = resting_pulse_rate + gi_upset + sweating + tremor + restlessness + yawning + pupil_size + anxiety_or_irritability + bone_or_joint_aches + gooseflesh_skin + runny_nose_or_tearing; Wesson 2003 appendix integers only; max 48",
  "max_score": 48,
  "score": 0
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_cows_item each COWS item must be a Wesson 2003 appendix integer for that sign (not an arbitrary 0-5). Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • CIWA-Ar — Sum the ten Sullivan 1989 CIWA-Ar items (nine caller-assigned 0-7 plus orientation 0-4) and return the published total (max 67).
  • CAGE — Sum the four Ewing 1984 CAGE items and return whether two or more answers are affirmative.
  • AUDIT-C — Sum three caller-assigned Bush 1998 AUDIT-C integers (0-4) and return this paper's ≥3 and ≥4 screens.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /docs/mcp.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.