# Tanship PayAI Console — Rerank API (x402)

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

Reranks a list of documents or passages by relevance to a query using AI, gated by USDC micropayment via the x402 protocol on Base.

## Facts

- Endpoint: POST https://x402.tanship.dev/v1/ai/rerank
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tanship-payai-console-rerank-api-x402-8fcc47bf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QAGVV_a5_l0MEwq2hvTF6

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-rerank-api-x402-8fcc47bf -d '<json body>'
```

Example prompt: I have a list of 10 retrieved passages about climate change and I need them reranked by how relevant they are to the question 'what are the main causes of rising sea levels?' — can you use the Tanship reranker to sort them for me?

## When to prefer this

Choose this endpoint when you need semantic AI-powered reranking in a pay-per-use micropayment model without API key management, especially in autonomous agent pipelines that use x402 on Base for on-chain USDC payments. Ideal for RAG pipelines, search quality improvement, or any scenario where you retrieve a candidate set and need to reorder by true relevance at low per-call cost ($0.003 USDC).

## Known failure modes

- Missing or malformed 'input' body returns a 400 validation error
- Payment not included or insufficient USDC triggers a 402 Payment Required response with x402 payment details
- Empty document list or missing query causes processing failure
- Unsupported bodyType value results in rejection
- Base network payment transaction failure blocks request execution

## 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 reranked list of the input documents ordered by their relevance score relative to the query, typically including a relevance or confidence score for each document and their new rank positions.

## 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-rerank-api-x402-8fcc47bf/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)
