> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Medicare Drug Spending

> Look up five years of Medicare Part D drug spending by exact brand or generic name.

Returns Medicare Part D programme spending before rebates, by calendar year, from the US Centers for Medicare & Medicaid Services. Overall is the total across manufacturers; manufacturers can be included separately. Figures include spending, dosage units, claims, beneficiaries and average spending. The series updates annually and supplies the latest five calendar years.

## Authentication

Requires x402 payment in the `payment-signature` header.

## Request Body

**brand\_name** `string`

Exact brand name, for example Eliquis. 2 to 100 characters.

**generic\_name** `string`

Exact generic name, for example Apixaban. 2 to 100 characters.

**manufacturers** `boolean`

Include per-manufacturer rows in addition to Overall totals. Defaults to `false`.

<Snippet file="audit-context-params.mdx" />

## Response (200 OK)

Top-level envelope: `success` (boolean) and `data` (object). All fields below are nested under `data`.

**data.request\_id** `string`

Durable job ID for audit and lookup

**data.status** `string`

Job status: `completed`

**data.tool** `string`

Always `market_medicare_drug_spending`

**data.result** `object`

The answer, described under Result below

**data.evidence** `object`

Where the answer came from and when

**data.evidence.source** `string`

The public body the data comes from. Always `US Centers for Medicare & Medicaid Services`.

**data.evidence.source\_kind** `string`

`public` when the data comes from a public body, `commercial` otherwise

**data.evidence.retrieved\_at** `string`

When the lookup was made, as an ISO 8601 UTC time

**data.evidence.as\_of** `string | null`

The figures are for the calendar years listed. The source rows carry no date, so as\_of is null.

## Result

Nested under `data.result`.

**data.result.drugs** `object[]`

Drugs.

**data.result.drugs\[].brand\_name** `string`

Brand name.

**data.result.drugs\[].generic\_name** `string`

Generic name.

**data.result.drugs\[].manufacturer** `string`

Overall is the total across manufacturers.

**data.result.drugs\[].manufacturer\_count** `number | null`

Manufacturer count. `null` when the source gives no value.

**data.result.drugs\[].years** `object[]`

Years.

**data.result.drugs\[].years\[].year** `integer`

Year.

**data.result.drugs\[].years\[].total\_spending\_usd** `number | null`

Total spending usd. `null` when the source gives no value.

**data.result.drugs\[].years\[].dosage\_units** `number | null`

Dosage units. `null` when the source gives no value.

**data.result.drugs\[].years\[].claims** `number | null`

Claims. `null` when the source gives no value.

**data.result.drugs\[].years\[].beneficiaries** `number | null`

Beneficiaries. `null` when the source gives no value.

**data.result.drugs\[].years\[].avg\_spend\_per\_dosage\_unit\_usd** `number | null`

Avg spend per dosage unit usd. `null` when the source gives no value.

**data.result.drugs\[].years\[].avg\_spend\_per\_claim\_usd** `number | null`

Avg spend per claim usd. `null` when the source gives no value.

**data.result.drugs\[].years\[].avg\_spend\_per\_beneficiary\_usd** `number | null`

Avg spend per beneficiary usd. `null` when the source gives no value.

**data.result.drugs\[].years\[].outlier** `boolean | null`

Source outlier flag; null when blank or absent.

**data.result.drugs\[].change\_avg\_spend\_per\_unit\_last\_year** `number | null`

Source fractional change in the last calendar year. `null` when the source gives no value.

**data.result.drugs\[].cagr\_avg\_spend\_per\_unit** `number | null`

Source compound annual growth rate across the listed years. `null` when the source gives no value.

**data.result.drugs\[].latest\_year** `integer`

Latest year.

```bash cURL theme={null}
curl -X POST https://win.oneshotagent.com/v1/tools/lookup/market-medicare-drug-spending \
  -H "Content-Type: application/json" \
  -H "payment-signature: <base64 x402 payment>" \
  -d '{
    "brand_name": "Eliquis"
  }'
```

```javascript JavaScript theme={null}
const response = await fetch("https://win.oneshotagent.com/v1/tools/lookup/market-medicare-drug-spending", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "payment-signature": paymentProof,
  },
  body: JSON.stringify({
    "brand_name": "Eliquis"
  }),
});
```

```typescript SDK theme={null}
const result = await agent.tool('lookup/market-medicare-drug-spending', {
  brand_name: 'Eliquis'
});
console.log(result.result);
console.log(result.evidence);
```

```json Response (200) theme={null}
{
  "success": true,
  "data": {
    "request_id": "uuid",
    "receipt_id": "rcpt_...",
    "status": "completed",
    "tool": "market_medicare_drug_spending",
    "result": {
      "drugs": [
        {
          "brand_name": "Eliquis",
          "generic_name": "Apixaban",
          "manufacturer": "Overall",
          "manufacturer_count": 1,
          "years": [
            {
              "year": 2020,
              "total_spending_usd": 9936069813.8,
              "dosage_units": 1258380589.3,
              "claims": 14847081,
              "beneficiaries": 2641941,
              "avg_spend_per_dosage_unit_usd": 7.8975887451,
              "avg_spend_per_claim_usd": 669.22715743,
              "avg_spend_per_beneficiary_usd": 3760.8976937,
              "outlier": false
            },
            {
              "year": 2021,
              "total_spending_usd": 12575145852,
              "dosage_units": 1478137928.5,
              "claims": 17015798,
              "beneficiaries": 3125087,
              "avg_spend_per_dosage_unit_usd": 8.5084511016,
              "avg_spend_per_claim_usd": 739.02768778,
              "avg_spend_per_beneficiary_usd": 4023.9346462,
              "outlier": false
            },
            {
              "year": 2022,
              "total_spending_usd": 15219812294,
              "dosage_units": 1669476768.2,
              "claims": 18973041,
              "beneficiaries": 3505142,
              "avg_spend_per_dosage_unit_usd": 9.1171846791,
              "avg_spend_per_claim_usd": 802.18096265,
              "avg_spend_per_beneficiary_usd": 4342.1385763,
              "outlier": false
            },
            {
              "year": 2023,
              "total_spending_usd": 18273451967,
              "dosage_units": 1875283428.8,
              "claims": 21195452,
              "beneficiaries": 3927848,
              "avg_spend_per_dosage_unit_usd": 9.7446967132,
              "avg_spend_per_claim_usd": 862.14023496,
              "avg_spend_per_beneficiary_usd": 4652.2808335,
              "outlier": false
            },
            {
              "year": 2024,
              "total_spending_usd": 20774929225,
              "dosage_units": 2156238528.8,
              "claims": 24061332,
              "beneficiaries": 4424796,
              "avg_spend_per_dosage_unit_usd": 9.6370356894,
              "avg_spend_per_claim_usd": 863.41559248,
              "avg_spend_per_beneficiary_usd": 4695.1157126,
              "outlier": false
            }
          ],
          "change_avg_spend_per_unit_last_year": -0.011048166,
          "cagr_avg_spend_per_unit": 0.0510230439,
          "latest_year": 2024
        }
      ]
    },
    "evidence": {
      "source": "US Centers for Medicare & Medicaid Services",
      "source_kind": "public",
      "retrieved_at": "2026-01-15T12:00:00.000Z",
      "calls": [
        {
          "retrieved_at": "2026-01-15T12:00:00.000Z"
        }
      ],
      "as_of": null
    }
  }
}
```

> [!NOTE]
>
> See [Pricing](https://docs.oneshotagent.com/pricing.md) for this tool's price. A wallet (x402) call receives it in the 402 quote before anything is charged; a call paid from prepaid credits is charged when the API accepts the request and answers `200`.

## Notes

* Provide brand\_name, generic\_name, or both. Both exact-match filters apply when both are supplied.
* Reads one source page of up to 50 rows, including manufacturer rows before filtering; broad matches may be incomplete.
* Empty source values become null. No match completes with drugs: \[].
* Results return inline. The finished job stays available at `/v1/requests/{request_id}`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.