# Agent402 UK Semver Comparator

> Agent402 UK Semver Comparator is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status down (last checked 2026-09-15).

Compares two semantic version strings (major.minor.patch) and returns the ordering relation (lt, eq, gt) with validity confirmation.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/semver
- Price: $0.001/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-semver-comparator-7be61858
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6Tn1Xsuabak5CpRQC2hYE

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 agent402-uk-semver-comparator-7be61858 -d '<json body>'
```

Example prompt: Is version 1.9.2 less than, equal to, or greater than 2.0.0? I need a definitive comparison so I can decide whether to block the deployment.

## When to prefer this

Use this endpoint when an agent needs a deterministic, authoritative semver comparison without relying on an LLM to guess version ordering — especially useful in CI/CD gates, dependency checks, or any workflow where version logic correctness is critical. Prefer it over asking an LLM directly when you need the 'valid' flag to also confirm input well-formedness.

## Known failure modes

- Invalid or malformed semver string returns valid:false with relation undefined
- Missing 'a' or 'b' field causes a 400-level error
- Pre-release or build-metadata suffixes (e.g. 1.0.0-beta) may affect validity flag
- Network timeout or payment failure returns a 402 or 5xx response

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a JSON object with three fields: 'cmp' (integer: -1 if a < b, 0 if equal, 1 if a > b), 'valid' (boolean indicating both inputs are well-formed semver), and 'relation' (string: 'lt', 'eq', or 'gt').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "description": "Left version"
  },
  "b": {
   "type": "string",
   "description": "Right version"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "cmp": -1,
  "valid": true,
  "relation": "lt"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-semver-comparator-7be61858/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
