# FastX402 Semantic Version Comparator

> FastX402 Semantic Version Comparator is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-28).

Compares two semantic version strings and returns their ordering relationship and parsed components

## Facts

- Endpoint: GET https://fastx402.tools/semver-compare?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-semantic-version-comparator-fba5b761
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_D1jlZNY57q3ERc0JctN8r

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 fastx402-semantic-version-comparator-fba5b761
```

Example prompt: Compare these two versions for me — which one is greater: 2.3.0-beta.1 or 2.3.0-alpha.5?

## When to prefer this

Use this endpoint when you need strict semver-spec-compliant comparison including prerelease precedence rules, or when you need the parsed breakdown of version components. Prefer it over string sorting or regex-based comparisons, which fail on prerelease ordering (e.g. 1.0.0-alpha < 1.0.0).

## Known failure modes

- Invalid semver string (e.g. missing patch segment) may return an error or unexpected parse
- Missing required query parameters 'a' or 'b' returns a validation error
- Build metadata differences may be ignored per semver spec, resulting in comparison=0 even when build strings differ
- Payment failure via x402 protocol blocks the request entirely

## How this service works

200 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

Returns a JSON object containing both input version strings, each parsed into major, minor, patch, prerelease, and build fields, plus a human-readable relation string (e.g. 'a < b') and a numeric comparison value (-1, 0, or 1) indicating ordering.

## 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",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "First semantic version string (e.g. 1.2.3-beta.4+build.5)"
      },
      "b": {
       "type": "string",
       "description": "Second semantic version string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "a": {
       "type": "string"
      },
      "b": {
       "type": "string"
      },
      "a_parsed": {
       "type": "object",
       "properties": {
        "build": {
         "type": "array",
         "items": {}
        },
        "major": {
         "type": "integer"
        },
        "minor": {
         "type": "integer"
        },
        "patch": {
         "type": "integer"
        },
        "prerelease": {
         "type": "array",
         "items": {
          "type": "string"
         }
        }
       }
      },
      "b_parsed": {
       "type": "object",
       "properties": {
        "build": {
         "type": "array",
         "items": {}
        },
        "major": {
         "type": "integer"
        },
        "minor": {
         "type": "integer"
        },
        "patch": {
         "type": "integer"
        },
        "prerelease": {
         "type": "array",
         "items": {
          "type": "string"
         }
        }
       }
      },
      "relation": {
       "type": "string"
      },
      "comparison": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "a": "1.0.0-alpha.1",
  "b": "1.0.0-alpha.2",
  "a_parsed": {
   "build": [],
   "major": 1,
   "minor": 0,
   "patch": 0,
   "prerelease": [
    "alpha",
    1
   ]
  },
  "b_parsed": {
   "build": [],
   "major": 1,
   "minor": 0,
   "patch": 0,
   "prerelease": [
    "alpha",
    2
   ]
  },
  "relation": "a < b",
  "comparison": -1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-semantic-version-comparator-fba5b761/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fastx402.tools](https://www.zero.xyz/host/fastx402.tools/llms.txt)
