# Damerau-Levenshtein Distance & Similarity

> Damerau-Levenshtein Distance & 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 Damerau-Levenshtein edit distance between two strings (counting insertions, deletions, substitutions, and adjacent transpositions) plus a normalized similarity score in [0,1].

## Facts

- Endpoint: POST https://similarity.openverbs.com/v1/damerau
- 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/damerau-levenshtein-distance-similarity-ef0b9460
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bK0gdLnB12coUfHoSBDA_

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 damerau-levenshtein-distance-similarity-ef0b9460 -d '<json body>'
```

Example prompt: What's the Damerau-Levenshtein distance and normalized similarity between 'recieve' and 'receive'? I want to see if transpositions like that count as a single edit.

## When to prefer this

Choose this endpoint over plain Levenshtein when your use case involves detecting transposition errors (e.g. 'teh' vs 'the', 'recieve' vs 'receive'), which are among the most common human typing mistakes. It is more accurate than standard Levenshtein for spell-checking and OCR correction tasks. Prefer it over Jaro-Winkler or Dice for cases where edit-count semantics matter and you need an integer distance alongside the normalized score. Use Hamming instead only when strings are guaranteed equal length and transpositions are not relevant.

## Known failure modes

- Missing required fields 'a' or 'b' returns a validation error
- Strings exceeding 20,000 characters are rejected
- Empty string inputs may return distance 0 or the length of the other string depending on implementation
- Non-UTF-8 or binary content may cause unexpected results

## How this service works

Damerau-Levenshtein distance — like Levenshtein but also counts adjacent transpositions as a single edit — plus a normalized similarity in [0,1].

## Output

Returns the integer Damerau-Levenshtein edit distance between the two input strings (counting insertions, deletions, substitutions, and adjacent transpositions each as one edit), along with a normalized similarity score in the range [0,1] where 1.0 means the strings are identical and 0.0 means completely dissimilar.

## 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/damerau-levenshtein-distance-similarity-ef0b9460/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)
