# document-rerank

> document-rerank is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Ranks up to 50 documents by relevance to a query, returning each with a relevance probability score sorted highest first.

## Facts

- Endpoint: GET https://x402.agentindex.world/rank?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/document-rerank-426c47e3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_skjjEl2_U9hGLSk7qJUa8

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 document-rerank-426c47e3
```

Example prompt: Rank these 10 passages by how relevant they are to the question 'what are the side effects of ibuprofen?' and give me back each one with its relevance score.

## When to prefer this

Choose this endpoint when you need a fast, pay-per-call document reranker without hosting your own cross-encoder model — ideal for RAG pipelines, retrieval post-processing, or any scenario where you have a candidate set of up to 50 text chunks and need them ordered by semantic relevance to a query. At $0.001 per call it is cost-effective for frequent reranking tasks and eliminates infrastructure overhead.

## Known failure modes

- Empty documents array returns a validation error
- Documents exceeding 50 items are rejected
- Each document truncated to 2000 characters silently before scoring, potentially losing context
- Ambiguous or very short query strings may produce low-confidence uniform scores
- Non-English queries or documents may yield degraded ranking quality

## How this service works

Rank up to 50 documents by relevance to a query in a single call - each document returned with its relevance probability, sorted highest first. Try GET /rank/sample.

## Output

A list of up to 50 documents returned in descending order of relevance, each accompanied by its relevance probability score (a float between 0 and 1), allowing the caller to select the top-N most relevant documents for downstream use.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "description": "The query to rank documents against."
  },
  "documents": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "maxItems": 50,
   "minItems": 1,
   "description": "Up to 50 documents to rank by relevance to the query. Each truncated to 2000 characters before scoring."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "documents": [
   {
    "score": 1,
    "document": "A guide to RESTful resource naming conventions and correct HTTP verb usage."
   },
   {
    "score": 0,
    "document": "A blog post comparing REST API versioning strategies: URL path, header, and query param versioning."
   },
   {
    "score": 0,
    "document": "A recipe for chocolate cake with step-by-step baking instructions."
   }
  ],
  "x402_receipt": {
   "upstream": "rerank",
   "latency_ms": 405,
   "model_served": "jev",
   "price_paid_usdc": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/document-rerank-426c47e3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
