# semver-compare

> semver-compare is a paid API for AI agents from intel.rallylive.ca, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Compare two semantic versions, check if a version satisfies a range, or sort a list of versions with prerelease handling

## Facts

- Endpoint: GET https://intel.rallylive.ca/dev/semver
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/semver-compare-836f5af3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sfXvSFaNdqsw9yGq5mk99

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 semver-compare-836f5af3
```

Example prompt: Compare 2.1.0-beta.3 and 2.1.0 to tell me which is newer, and also check if 2.1.0-beta.3 satisfies the range ^2.0.0.

## When to prefer this

Use this endpoint when you need a lightweight, pay-per-call semver utility without bundling a full semver library. Ideal for agents that occasionally need to compare, validate, or sort version strings in automation pipelines, CI checks, or dependency audits. Prefer over a local library when running in a serverless or constrained environment.

## Known failure modes

- Invalid semver string causes parse error or unexpected result
- Unsupported range syntax not covered by the API
- Missing required query parameters returns an error
- Non-semver version strings (e.g. CalVer, date-based) may fail to parse correctly

## How this service works

Semantic-version helper: compare two versions (-1/0/1 with which is newer), test whether a version satisfies a range (^, ~, >=, <, x-ranges, hyphen ranges, ||), or sort a comma/space list of versions descending with prerelease handling. Parses major/minor/patch/prerelease/build. $0.01 per operation.

## Output

Returns a comparison integer (-1, 0, or 1) for two-version comparisons indicating which is newer; a boolean for range satisfaction checks; or an ordered list of version strings sorted descending for sort operations. Also exposes parsed components: major, minor, patch, prerelease, and build metadata.

## 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",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/semver-compare-836f5af3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from intel.rallylive.ca](https://www.zero.xyz/host/intel.rallylive.ca/llms.txt)
