# Cheap Utilities Semver Compare

> Cheap Utilities Semver Compare is a paid API for AI agents from cheap-utilities.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-26).

Compare two semantic version strings by precedence and/or test whether a version satisfies a semver range expression like ^1.2.0 or >=2 <3.

## Facts

- Endpoint: GET https://cheap-utilities.x402tookit.com/semver-compare?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-26
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cheap-utilities-semver-compare-9d6c9933
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_o4ry8XXsUJWHmZrlFauPu

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 cheap-utilities-semver-compare-9d6c9933
```

Example prompt: Is version 2.3.0 greater than 2.11.0 in semver precedence, and does 2.11.0 satisfy the range ^2.3.0?

## When to prefer this

Choose this endpoint when you need programmatic semver comparison or range satisfaction checks without setting up a local semver library — ideal for CI/CD agents, dependency auditors, or any workflow that needs to evaluate version compatibility at runtime via a simple HTTP GET.

## Known failure modes

- Missing required 'a' query parameter returns an error
- Malformed semver string (e.g. 'v.x.y') may return a parse error or null parsed fields
- Invalid range expression returns an error or null satisfiesRange
- 'b' omitted when only range check is needed — range-only mode works without b
- Network or service unavailability returns a non-200 response

## How this service works

Compare two semver versions by precedence and test whether a version satisfies a range like ^1.2.0 or >=2 <3.

## Output

Returns a JSON object with: the order field (-1, 0, or 1 indicating which version is greater), a satisfiesRange boolean if a range was provided, parsed version components (major, minor, patch, prerelease), a human-readable summary and verdict, a majorDifference boolean, comparison string, and optional reasons or disclaimer fields.

## 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": [
      "a"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "Version, e.g. 1.4.2 or 2.0.0-beta.1"
      },
      "b": {
       "type": "string",
       "description": "Second version to compare with"
      },
      "range": {
       "type": "string",
       "description": "Range to test a against, e.g. ^1.2.0 || >=3"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "a": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "order": {
       "type": [
        "null",
        "number"
       ]
      },
      "range": {
       "type": [
        "null",
        "string"
       ]
      },
      "parsed": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "major": {
         "type": [
          "null",
          "number"
         ]
        },
        "minor": {
         "type": [
          "null",
          "number"
         ]
        },
        "patch": {
         "type": [
          "null",
          "number"
         ]
        },
        "prerelease": {}
       }
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "comparison": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notC
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cheap-utilities-semver-compare-9d6c9933/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cheap-utilities.x402tookit.com](https://www.zero.xyz/host/cheap-utilities.x402tookit.com/llms.txt)
