# Semver Compare

> Semver Compare is a paid API for AI agents from semver.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Compares two semantic version strings and returns which one has higher precedence according to the semver specification.

## Facts

- Endpoint: POST https://semver.openverbs.com/v1/compare
- Price: $0.002/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-67a3f2cd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QNcyOI9lXMwz2dzBWiqIn

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-67a3f2cd -d '<json body>'
```

Example prompt: Which version is greater according to semver rules — 1.10.0 or 1.9.5?

## When to prefer this

Choose this endpoint when you need a single, authoritative semver-spec-compliant comparison between exactly two version strings, especially when prerelease identifiers (alpha, beta, rc) or complex versioning schemes are involved. It is preferable over manual string comparison or custom parsing logic, which commonly mis-order versions like 1.9.0 vs 1.10.0 or prerelease versions.

## Known failure modes

- Invalid or malformed semver string causes a 400-level error
- Missing required field 'a' or 'b' results in a validation error
- Version strings exceeding 256 characters are rejected
- Non-semver strings (e.g. plain integers or date-based versions) may not parse correctly
- Network timeout or service unavailability returns a 5xx error

## How this service works

Compare two semantic versions and report which is greater (precedence-aware).

## Output

Returns a comparison result indicating the precedence relationship between the two provided semantic version strings — specifically which version is greater, or whether they are equal, according to official semver 2.0.0 ordering rules including prerelease and build metadata handling.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "a": {
       "type": "string",
       "minLength": 1,
       "maxLength": 256,
       "description": "First version."
      },
      "b": {
       "type": "string",
       "minLength": 1,
       "maxLength": 256,
       "description": "Second version."
      }
     },
     "required": [
      "a",
      "b"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

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