# npm Package API Breaking-Change Diff

> npm Package API Breaking-Change Diff is a paid API for AI agents from x402-canary.nicolas-x402-16f380a7.workers.dev, paid per call via x402, $0.025/call, status unknown (last checked 2026-09-15).

Compares two versions of an npm package and returns a structured diff of added, changed, and removed TypeScript/API symbols with a risk assessment.

## Facts

- Endpoint: POST https://x402-canary.nicolas-x402-16f380a7.workers.dev/v1/agent/npm-api-diff
- Price: $0.025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-package-api-breaking-change-diff-b484ffff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_g1gzECX2jCKFcikAQN5rd

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 npm-package-api-breaking-change-diff-b484ffff -d '<json body>'
```

Example prompt: Can you check what breaking changes exist between hono 4.12.0 and 4.13.2 — specifically any removed or changed symbols I need to worry about before upgrading?

## When to prefer this

Use this endpoint when an AI coding agent needs to automatically assess upgrade safety for an npm package before modifying package.json, generating migration code, or advising a developer. It is ideal over manual changelog parsing because it returns structured, machine-readable symbol diffs with a risk classification specifically from TypeScript API signatures.

## Known failure modes

- Unknown or misspelled package name returns an error or empty result
- Version string not found on npm registry returns a version-not-found error
- Malformed semver strings may cause parsing failures
- Packages without TypeScript typings may yield empty symbol arrays with no meaningful diff
- Network timeout if the npm registry is slow to respond

## How this service works

Free need-to-tool routing plus pay-per-call npm docs and TypeScript API signatures, npm breaking-change diffs, JavaScript-rendered browser snapshots and deterministic coding-agent checks via AgentCash/x402.

## Output

Returns a JSON object with a risk field ('LOW', 'MEDIUM', or 'HIGH'), the package name, from and to versions, and three arrays: added_symbols, changed_symbols, and removed_symbols — each describing TypeScript/API surface changes between the two specified versions.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "package": {
   "type": "string",
   "example": "hono",
   "maxLength": 214
  },
  "to_version": {
   "type": "string",
   "example": "4.13.2",
   "maxLength": 100
  },
  "from_version": {
   "type": "string",
   "example": "4.12.0",
   "maxLength": 100
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "risk": "MEDIUM",
   "package": "hono",
   "to_version": "4.13.2",
   "from_version": "4.12.0",
   "added_symbols": [],
   "changed_symbols": [],
   "removed_symbols": []
  },
  "meta": {
   "engine": "npm-api-diff"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-package-api-breaking-change-diff-b484ffff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-canary.nicolas-x402-16f380a7.workers.dev](https://www.zero.xyz/host/x402-canary.nicolas-x402-16f380a7.workers.dev/llms.txt)
