# Agent Tools – Text Similarity (BGE-M3 Cosine)

> Agent Tools – Text Similarity (BGE-M3 Cosine) is a paid API for AI agents from agents.crowdspark.me, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Computes semantic similarity between two texts using BGE-M3 embeddings and returns a cosine score plus a qualitative band (near_duplicate, high, related, weak, unrelated).

## Facts

- Endpoint: POST https://agents.crowdspark.me/v1/text/similarity?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-tools-text-similarity-bge-m3-cosine-84f344f7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RH-3qMShRCLiHUR-yHfEu

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 agent-tools-text-similarity-bge-m3-cosine-84f344f7 -d '<json body>'
```

Example prompt: How semantically similar are these two texts? First: 'The quick brown fox jumps over the lazy dog.' Second: 'A fast auburn fox leaps above a sleepy hound.' Give me the cosine score and the similarity band.

## When to prefer this

Choose this endpoint when you need multilingual semantic similarity with a high-quality dense embedding model (BGE-M3, 1024 dimensions) and want a ready-made qualitative band alongside the raw score. Ideal for RAG pipeline chunk ranking, deduplication workflows, and semantic matching tasks where storing texts is undesirable. Prefer it over keyword-based matching when meaning matters more than token overlap, and over heavier LLM-based comparisons when cost and latency are a concern at $0.003 per call.

## Known failure modes

- Input text exceeds 8,000 characters — likely a 400 or payload-too-large error
- Missing 'a' or 'b' field in JSON body — validation error returned
- Network timeout for very long texts near the character limit
- Payment not attached or insufficient USDC — 402 Payment Required response

## How this service works

Pay-per-call utilities for AI agents over x402, USDC on Base.

## Output

A JSON object containing: the cosine similarity score (float 0–1), a qualitative band ('near_duplicate', 'high', 'related', 'weak', or 'unrelated'), the embedding model used ('baai/bge-m3'), the metric ('cosine'), the number of embedding dimensions (1024), and character counts for both input texts. Texts are not stored.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "band": "high",
  "chars": {
   "a": 23,
   "b": 27
  },
  "model": "baai/bge-m3",
  "metric": "cosine",
  "dimensions": 1024,
  "similarity": 0.8123
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-tools-text-similarity-bge-m3-cosine-84f344f7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.crowdspark.me](https://www.zero.xyz/host/agents.crowdspark.me/llms.txt)
