# Jaccard Similarity Calculator (Bigram/Word)

> Jaccard Similarity Calculator (Bigram/Word) 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 the Jaccard similarity coefficient between two strings using character bigrams or word tokens, returning a score from 0 (no overlap) to 1 (identical sets).

## Facts

- Endpoint: POST https://agent402.tools/api/jaccard-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/jaccard-similarity-calculator-bigram-word-86882d90
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qSFlBM82Dka1ovdglQSvG

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 jaccard-similarity-calculator-bigram-word-86882d90 -d '<json body>'
```

Example prompt: What's the Jaccard similarity between 'machine learning algorithms' and 'deep learning algorithms' using word tokens?

## When to prefer this

Use this endpoint when you need a fast, deterministic, interpretable set-overlap similarity metric between two strings, especially when you want to choose between character-level (bigram) and word-level tokenization. Prefer over cosine/embedding similarity when you need a reproducible CPU-only computation with no ML model dependency and a clear mathematical definition.

## Known failure modes

- Missing required fields 'a' or 'b' — returns error
- Invalid 'mode' value not in ['bigram','word'] — returns validation error
- Empty strings may yield a score of 0 or undefined behavior
- Payment failure via x402 protocol if USDC balance is insufficient

## How this service works

Compute the Jaccard similarity coefficient between two strings using character bigrams or word tokens. Returns the ratio of intersection to union (0 = no overlap, 1 = identical sets). Deterministic, pure CPU.

## Output

A numeric Jaccard similarity coefficient between 0.0 and 1.0, where 0 means no shared tokens/bigrams and 1 means the two strings are identical in their token/bigram sets.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "description": "First string"
  },
  "b": {
   "type": "string",
   "description": "Second string"
  },
  "mode": {
   "enum": [
    "bigram",
    "word"
   ],
   "type": "string",
   "description": "Tokenization mode: \"bigram\" (character bigrams) or \"word\" (whitespace-delimited tokens). Default: \"word\"."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "bigram",
  "union": 7,
  "similarity": 0.142857,
  "intersection": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/jaccard-similarity-calculator-bigram-word-86882d90/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)
