# Text Similarity Scorer

> Text Similarity Scorer is a paid API for AI agents from text-metrics.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Compares two texts using edit distance, Jaccard word overlap, and cosine similarity, returning numeric scores and a same/similar/different verdict.

## Facts

- Endpoint: GET https://text-metrics.x402tookit.com/text-similarity?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/text-similarity-scorer-a2be0f0b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__CIcEBjm4AF818Sz171lS

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 text-similarity-scorer-a2be0f0b
```

Example prompt: Can you compare these two paragraphs and tell me how similar they are — I want to know the Jaccard, cosine, and edit distance scores, and whether they count as the same, similar, or different: 'The cat sat on the mat.' vs 'A cat was sitting on a mat.'

## When to prefer this

Choose this endpoint when you need a multi-metric text similarity comparison that combines edit distance, word overlap, and cosine similarity in a single call with a human-readable verdict. It is ideal for duplicate detection, plagiarism checking, paraphrase detection, or content change monitoring where a nuanced score rather than a binary yes/no is needed. Prefer this over single-metric APIs when you want triangulated confidence across three distinct similarity methods.

## Known failure modes

- Missing required query parameters 'a' or 'b' returns an error
- Input text exceeding 1500 characters for field 'a' may be truncated or rejected
- Empty string inputs may produce degenerate similarity scores
- Very long texts for parameter 'b' may degrade performance or accuracy
- Network or upstream service errors returning non-200 responses
- Payment failure via x402 protocol preventing request from completing

## How this service works

Similarity of two texts by edit distance, word overlap (Jaccard) and cosine, with a same, similar or different verdict.

## Output

Returns numeric similarity scores including Levenshtein edit similarity (0–1), Jaccard word overlap (0–1), cosine word-count similarity (0–1), the raw Levenshtein distance, character lengths of both inputs, a plain-English summary, a list of reasons supporting the verdict, and a final verdict string of 'same', 'similar', or 'different'. May also include a degraded flag and disclaimer if computation was limited.

## 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",
       "description": "First text (up to 1500 characters)"
      },
      "b": {
       "type": "string",
       "description": "Second text"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "lengths": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "a": {
         "type": [
          "null",
          "number"
         ]
        },
        "b": {
         "type": [
          "null",
          "number"
         ]
        }
       }
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "jaccardWords": {
       "type": [
        "null",
        "number"
       ]
      },
      "editSimilarity": {
       "type": [
        "null",
        "number"
       ]
      },
      "cosineWordCounts": {
       "type": [
        "null",
        "number"
       ]
      },
      "levenshteinDistance": {
       "type": [
        "null",
        "number"
       ]
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/text-similarity-scorer-a2be0f0b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from text-metrics.x402tookit.com](https://www.zero.xyz/host/text-metrics.x402tookit.com/llms.txt)
