# fastapi.online — Text Similarity Scoring

> fastapi.online — Text Similarity Scoring is a paid API for AI agents from api.fastapi.online, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Computes a semantic similarity score between two input texts, returning a numeric value indicating how similar they are.

## Facts

- Endpoint: POST https://api.fastapi.online/similarity
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastapi-online-text-similarity-scoring-0dc046ca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_83izXp-itgD7dcEa7OLrw

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 fastapi-online-text-similarity-scoring-0dc046ca -d '<json body>'
```

Example prompt: Score how similar these two sentences are: 'The cat sat on the mat' and 'A feline rested on the rug' — give me the similarity value.

## When to prefer this

Choose this endpoint when you need a quick, low-cost ($0.001 USDC) semantic similarity score between exactly two text strings, require no signup or account, and want to pay per call with crypto via x402. Prefer it over embedding-based pipelines when you want a single similarity number without managing vector stores.

## Known failure modes

- Missing text_a or text_b field returns a validation error
- Empty string inputs may return a score of 1.0 or behave unexpectedly
- Payment failure (insufficient USDC) results in a 402 Payment Required response
- Very long texts may exceed model context limits and return an error
- Network timeout if the self-hosted inference backend is overloaded

## How this service works

Chat, embeddings, OCR, speech-to-text, image editing, image understanding (captioning/Q&amp;A), text-to-speech, translation, writing tools, classification tools, developer tools, local utilities, format/checksum validators, encoding &amp; crypto utilities, date/time calculators, geo/coordinate math, math &amp; finance calculators, novelty tools, and business/social writing generators — 179 endpoints in all, across multiple specialized self-hosted models. Pay per call with crypto — no signup — or get an API key.

## Output

Returns a JSON object containing a 'similarity' field with a numeric score (typically between 0 and 1) representing the semantic closeness of the two input texts, where higher values indicate greater similarity.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text_a": {
   "type": "string",
   "maxLength": 8000,
   "minLength": 1
  },
  "text_b": {
   "type": "string",
   "maxLength": 8000,
   "minLength": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastapi-online-text-similarity-scoring-0dc046ca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fastapi.online](https://www.zero.xyz/host/api.fastapi.online/llms.txt)
