# Tanship PayAI Console — Text Similarity API

> Tanship PayAI Console — Text Similarity API is a paid API for AI agents from x402.tanship.dev, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Computes semantic similarity scores between text inputs using payment-gated AI, requiring USDC microtransaction per call via x402 protocol on Base

## Facts

- Endpoint: POST https://x402.tanship.dev/v1/ai/similarity
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tanship-payai-console-text-similarity-api-d8076181
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sx1x5TIj3HrqDUp1Dp09I

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 tanship-payai-console-text-similarity-api-d8076181 -d '<json body>'
```

Example prompt: Tell me how semantically similar these two sentences are: 'The quick brown fox jumps over the lazy dog' and 'A fast auburn fox leaps above a sleepy hound' — use Tanship's similarity endpoint and pay the microfee in USDC.

## When to prefer this

Choose this endpoint when you need pay-per-call semantic text similarity without managing API keys or subscriptions — ideal for agents that compare text infrequently and want trustless micropayment billing via USDC on Base. Prefer over embedding-based DIY pipelines when you want a single similarity score rather than raw embedding vectors.

## Known failure modes

- Payment not provided or insufficient USDC — returns HTTP 402 with x402 payment requirements
- Malformed request body (missing required 'input' field or incorrect bodyType enum) — returns 400 Bad Request
- Network or edge AI inference failure — returns 500 Internal Server Error
- Invalid x402 payment scheme or wrong chain (not Base eip155:8453) — payment rejected, request blocked

## How this service works

Payment-gated AI and browser automation API using the x402 protocol. All /v1/* endpoints require USDC payment on Base (eip155:8453) via x402 v2 exact scheme.

## Output

A numeric similarity score (typically 0–1 cosine similarity) indicating how semantically close two text inputs are, computed via edge AI on the Tanship platform after a $0.004 USDC payment is processed on Base via x402 v2.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tanship-payai-console-text-similarity-api-d8076181/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.tanship.dev](https://www.zero.xyz/host/x402.tanship.dev/llms.txt)
