# agent402.tools Text Similarity

> agent402.tools Text Similarity is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Computes Jaccard similarity, overlap coefficient, and Sorensen-Dice coefficient between two texts at the word level, returning similarity scores and word overlap statistics.

## Facts

- Endpoint: POST https://agent402.tools/api/text-similarity
- 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/agent402-tools-text-similarity-1a49fedf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RsgIeoWk_5y6dRQTSdjs5

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-tools-text-similarity-1a49fedf -d '<json body>'
```

Example prompt: Can you tell me how similar these two texts are — 'The quick brown fox jumps over the lazy dog' and 'The fast brown fox leaps over the sleepy dog' — and give me the Jaccard, overlap, and Dice similarity scores?

## When to prefer this

Use this endpoint when you need fast, word-level lexical similarity metrics between two texts without needing semantic or embedding-based similarity. Ideal for deduplication checks, near-duplicate detection, or simple content comparison tasks where vocabulary overlap is the primary signal.

## Known failure modes

- Missing 'a' or 'b' field returns a 400 error
- Empty strings may produce undefined or zero scores
- Very long texts may increase latency
- Payment failure (402) if USDC balance is insufficient

## How this service works

Compute Jaccard similarity, overlap coefficient, and Sorensen-Dice coefficient between two texts at the word level. Returns similarity scores (0-1) plus shared and unique word counts.

## Output

Returns three similarity scores (Jaccard, overlap coefficient, Sorensen-Dice), each ranging from 0 to 1, along with counts of shared words and words unique to each text.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "shared": [
   "the",
   "brown",
   "fox",
   "over",
   "lazy"
  ],
  "jaccard": 0.55,
  "overlap": 0.75,
  "uniqueA": [
   "quick",
   "jumps",
   "dog"
  ],
  "uniqueB": [
   "fast",
   "leaps",
   "cat"
  ],
  "sorensen": 0.71,
  "sharedCount": 5,
  "totalUnique": 11
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-text-similarity-1a49fedf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
