# Levenshtein Edit Distance & Similarity API

> Levenshtein Edit Distance & Similarity API is a paid API for AI agents from x402-zoo.lolagent.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Calculates the Levenshtein edit distance and normalized similarity score between two strings for fuzzy matching and typo detection.

## Facts

- Endpoint: GET https://x402-zoo.lolagent.workers.dev/api/levenshtein
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/levenshtein-edit-distance-similarity-api-50a7a65f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-xXJ4WQ33tW5RxuGMvvuK

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-similarity-api-50a7a65f
```

Example prompt: What's the edit distance and similarity score between 'recieve' and 'receive'? I want to check if it's likely a typo.

## When to prefer this

Choose this endpoint when you need a precise, numeric edit-distance or similarity measure between exactly two strings — ideal for typo detection, fuzzy deduplication, spell-check scoring, or any scenario requiring a normalized 0–1 similarity score. Prefer this over semantic embedding similarity when character-level edit cost matters more than semantic meaning.

## Known failure modes

- Missing query parameter 'a' or 'b' returns a 400 bad request error
- Empty strings may return distance of 0 or length of the non-empty string
- Very long strings may increase computation time or hit length limits
- Payment failure or insufficient USDC balance returns 402 Payment Required

## How this service works

Calculate edit distance and normalized similarity between two strings for fuzzy matching and typo comparison.

## Output

Returns the integer Levenshtein edit distance (minimum single-character edits needed to transform string a into string b) and a normalized similarity score (float between 0 and 1, where 1 means identical strings) between the two input strings.

## 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"
      },
      "b": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/levenshtein-edit-distance-similarity-api-50a7a65f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-zoo.lolagent.workers.dev](https://www.zero.xyz/host/x402-zoo.lolagent.workers.dev/llms.txt)
