# Agent Tools – Semantic Reranker (bge-reranker-base)

> Agent Tools – Semantic Reranker (bge-reranker-base) is a paid API for AI agents from agents.crowdspark.me, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

Reranks up to 50 documents or RAG chunks by relevance to a query using a bge-reranker-base cross-encoder, returning results sorted by a 0-1 relevance score.

## Facts

- Endpoint: POST https://agents.crowdspark.me/v1/text/rerank?utm_source=zero.xyz
- Price: $0.005/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-semantic-reranker-bge-reranker-base-fe6a3e63
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2QFUkSEL5PYSwbeQXmT8F

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-semantic-reranker-bge-reranker-base-fe6a3e63 -d '<json body>'
```

Example prompt: Take these 20 research paper abstracts and rerank them by how relevant they are to the query 'CRISPR gene editing in somatic cells', then return the top 5 by relevance score.

## When to prefer this

Use this endpoint when you have a set of candidate documents or RAG chunks retrieved by keyword or vector search and need to rerank them by semantic relevance before passing to an LLM or presenting to a user. It is ideal for improving retrieval precision in RAG pipelines, reordering search results, or selecting the most relevant passages from a larger candidate set. Prefer it when you need a lightweight cross-encoder score rather than generating embeddings yourself, and when your batch is ≤50 documents each ≤2,000 chars.

## Known failure modes

- More than 50 documents submitted — request rejected
- Individual document text exceeds 2,000 characters — may be truncated or rejected
- Query exceeds 1,000 characters — rejected
- Empty documents array — returns empty results
- Payment not included or insufficient — HTTP 402 returned
- top_k value out of range (0 or >50) — validation error

## How this service works

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

## Output

Returns a JSON object with the model name ('baai/bge-reranker-base'), total document count, number returned, and a sorted array of results — each containing the rank (1-based), relevance score (0–1 float), original document index, and optionally the document text.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "description": "Search query, max 1,000 characters"
  },
  "top_k": {
   "type": "integer",
   "maximum": 50,
   "minimum": 1,
   "description": "Optional number of results, default all"
  },
  "documents": {
   "type": "array",
   "items": {
    "anyOf": [
     {
      "type": "string"
     },
     {
      "type": "object",
      "required": [
       "text"
      ],
      "properties": {
       "id": {
        "type": "string"
       },
       "text": {
        "type": "string"
       }
      }
     }
    ]
   },
   "maxItems": 50,
   "description": "1 to 50 strings or {id, text} objects, each max 2,000 characters"
  },
  "return_documents": {
   "type": "boolean",
   "description": "Optional, default true"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "baai/bge-reranker-base",
  "results": [
   {
    "rank": 1,
    "text": "Photosynthesis turns light, water and carbon dioxide into sugar.",
    "index": 0,
    "score": 0.9312
   },
   {
    "rank": 2,
    "text": "Chlorophyll absorbs sunlight in leaves.",
    "index": 2,
    "score": 0.4105
   }
  ],
  "returned": 2,
  "documents": 3
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-tools-semantic-reranker-bge-reranker-base-fe6a3e63/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)
