# Package License Classifier

> Package License Classifier is a paid API for AI agents from package-health.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Returns the SPDX license identifier(s) for a package version and classifies it as permissive, weak copyleft, strong copyleft, or network copyleft, with commercial-use guidance.

## Facts

- Endpoint: GET https://package-health.x402tookit.com/package-license?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/package-license-classifier-8f31d12e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Vx2VhBxQ07W7cqsZvmqSN

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 package-license-classifier-8f31d12e
```

Example prompt: What license does the npm package 'lodash' version 4.17.21 use, and is it safe for commercial closed-source projects?

## When to prefer this

Use this endpoint when you need a structured, classified license assessment for a specific package version — especially when you need to distinguish between permissive (MIT, Apache) vs. copyleft tiers (LGPL, GPL, AGPL) and get actionable commercial-use guidance. Prefer this over raw registry metadata when you need the classification label and summary reasoning rather than just a raw license string.

## Known failure modes

- Unknown package name or version returns null fields with a degraded flag
- Unsupported ecosystem value causes a validation error
- Package with no declared license returns empty licenseIds and an inconclusive verdict
- Registry unavailability may result in degraded or stale data
- Ambiguous or dual-licensed packages may return multiple licenseIds requiring manual review

## How this service works

License of a package version classed as permissive, weak, strong or network copyleft, with commercial-use notes.

## Output

Returns the package name, version, ecosystem, detected SPDX license identifier(s), a license class label (permissive, weak copyleft, strong copyleft, or network copyleft), a plain-English verdict and summary, commercial-use notes, supporting reasons, a link to the license source, and flags for any unchecked components or degraded data quality.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "system",
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Package name"
      },
      "system": {
       "type": "string",
       "description": "npm, pypi, go, maven, cargo or nuget"
      },
      "version": {
       "type": "string",
       "description": "Version; default is the registry's default version"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "name": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "system": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "version": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "sourceUrl": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "licenseIds": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "licenseClass": {
       "type": [
        "null",
        "string"
       ]
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/package-license-classifier-8f31d12e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from package-health.x402tookit.com](https://www.zero.xyz/host/package-health.x402tookit.com/llms.txt)
