# Levenshtein Edit Distance & Normalized Similarity

> Levenshtein Edit Distance & Normalized Similarity is a paid API for AI agents from similarity.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-15).

Computes the Levenshtein edit distance (insertions, deletions, substitutions) between two strings and returns a normalized similarity score in [0,1], operating on Unicode code points.

## Facts

- Endpoint: POST https://similarity.openverbs.com/v1/levenshtein
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/levenshtein-edit-distance-normalized-similarity-5d0147ee
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_L-6QUr3Kg5sR1HKARPge4

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 levenshtein-edit-distance-normalized-similarity-5d0147ee -d '<json body>'
```

Example prompt: What's the Levenshtein edit distance and normalized similarity between 'algorithm' and 'altruistic'?

## When to prefer this

Choose this endpoint when you need a character-level, order-sensitive edit distance metric that accounts for insertions, deletions, and substitutions — ideal for spell-checking, record linkage, fuzzy matching, and deduplication. Prefer Levenshtein over Jaro-Winkler when you need a simple, widely-understood distance count rather than a prefix-boosted score. Use Damerau-Levenshtein (sibling endpoint) instead if transpositions (e.g. 'teh' vs 'the') are common in your data. Use Jaccard or Sørensen-Dice if token-level or bigram overlap matters more than edit sequence.

## Known failure modes

- Missing required field 'a' or 'b' returns a validation error
- String exceeding 20,000 characters is rejected
- Empty string inputs may return distance equal to the length of the other string
- Network timeout for very long strings near the character limit
- Payment failure via x402 protocol blocks the request

## How this service works

Levenshtein edit distance (insertions, deletions, substitutions) between two strings, plus a normalized similarity in [0,1]. Operates on Unicode code points.

## Output

Returns the raw Levenshtein edit distance (an integer count of minimum insertions, deletions, and substitutions required to transform string a into string b) and a normalized similarity score in the [0,1] range, where 1.0 means identical and 0.0 means completely dissimilar. Operates correctly on full Unicode code points.

## 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",
       "maxLength": 20000,
       "description": "First string."
      },
      "b": {
       "type": "string",
       "maxLength": 20000,
       "description": "Second string."
      }
     },
     "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/levenshtein-edit-distance-normalized-similarity-5d0147ee/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from similarity.openverbs.com](https://www.zero.xyz/host/similarity.openverbs.com/llms.txt)
