# Agent402 UK String Similarity

> Agent402 UK String Similarity is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-10).

Computes Levenshtein edit distance and similarity ratio between two input strings (up to 2,000 characters each) for fuzzy matching and deduplication.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/similarity?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-string-similarity-8a7e20d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rdEImYj3tXNX1HbaafGKj

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-string-similarity-8a7e20d2 -d '<json body>'
```

Example prompt: Can you check how similar these two strings are: 'Jonathan Smith' and 'Jonathon Smyth'? I need the Levenshtein distance and the similarity ratio to decide if they're duplicates.

## When to prefer this

Choose this endpoint when you need a fast, exact Levenshtein-based string comparison mid-task — e.g. during deduplication pipelines, record linkage, fuzzy name matching, or address normalization — especially when you need both the raw edit distance and the normalized ratio in a single call. Prefer it over embedding-based similarity when you want a deterministic, character-level metric rather than semantic closeness.

## Known failure modes

- Either string exceeds the 2,000-character cap — request is rejected or truncated
- Missing required field 'a' or 'b' returns a validation error
- Non-string input types may cause a 400 bad request
- Empty string inputs may return ratio 1.0 or 0.0 depending on implementation edge cases

## 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

A JSON object containing a floating-point similarity ratio (0.0–1.0, where 1.0 is identical) and an integer Levenshtein edit distance representing the minimum number of single-character edits needed to transform string a into string b.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "description": "First string"
  },
  "b": {
   "type": "string",
   "description": "Second string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ratio": 0.571,
  "levenshtein": 3
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-string-similarity-8a7e20d2/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)
