# QuickBuild Reranker — BGE Document Reranking API

> QuickBuild Reranker — BGE Document Reranking API is a paid API for AI agents from quickbuild.quynguyenbac.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-21).

Reranks a list of documents by relevance to a query using BGE reranker models, returning scored results ordered by relevance.

## Facts

- Endpoint: GET https://quickbuild.quynguyenbac.workers.dev/v1/rerank?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/quickbuild-reranker-bge-document-reranking-api-aa91626c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WCUDQH3h2m9FMfIxl04be

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 quickbuild-reranker-bge-document-reranking-api-aa91626c
```

Example prompt: Rerank these 5 document chunks by how relevant they are to the query 'how does photosynthesis work?' using the bge-reranker-base model, return only the top 3 results with their scores.

## When to prefer this

Use this endpoint when you need a lightweight, pay-per-call cross-encoder reranker without managing your own GPU infrastructure. It is ideal for RAG pipelines that need to rerank retrieved chunks before feeding them to an LLM. Prefer bge-reranker-base for English-only tasks and speed; prefer bge-m3 for multilingual reranking. At $0.002/call it is cost-effective for moderate volumes. Choose this over embedding-only similarity when you need more accurate cross-encoder scoring.

## Known failure modes

- Missing required 'query' parameter returns an error or sample ranking
- More than 100 documents submitted exceeds the limit and may be truncated or rejected
- Documents exceeding token limits may be silently truncated (truncatedDocuments: true in response)
- Invalid model name not in ['bge-reranker-base','bge-m3'] returns an error
- top_n value greater than the number of documents submitted may return fewer results than requested
- Network timeout on the Cloudflare Workers edge if upstream AI model is slow

## How this service works

Landing pages ($15), Google Sheets/Apps Script automation ($10), scrapers, scripts & Telegram bots (from $15), broken-link + sitemap audit reports ($10). See a working demo first, pay after.

## Output

A JSON object containing a ranked list of results, each with the original document index and a relevance_score (0–1, higher is more relevant). Optionally includes the document text. Also returns the model name, a unique request ID, token usage stats, and a truncatedDocuments flag if any inputs were cut off.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "model": {
       "enum": [
        "bge-reranker-base",
        "bge-m3"
       ],
       "type": "string",
       "description": "Rerank model (default bge-reranker-base)."
      },
      "query": {
       "type": "string",
       "description": "Search query (max 2000 chars). Optional with documents omitted: a sample is ranked."
      },
      "top_n": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "description": "Return only the best N (default all)."
      },
      "documents": {
       "type": "array",
       "items": {
        "type": [
         "string",
         "object"
        ]
       },
       "description": "Documents to rank: strings or {text} objects (max 100)."
      },
      "return_documents": {
       "type": "boolean",
       "description": "Include the document text in each result (default false)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "id": {
       "type": "string"
      },
      "model": {
       "type": "string"
      },
      "usage": {
       "type": "object"
      },
      "results": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "index": {
          "type": "integer"
         },
         "document": {
          "type": "object",
          "properties": {
           "text": {
            "type": "string"
           }
          }
         },
         "relevance_score": {
          "type": "number"
         }
        }
       }
      },
      "truncatedDocuments": {
       "type": "boolean"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "rerank-3f2a9c1d",
  "model": "bge-reranker-base",
  "usage": {
   "total_tokens": 34,
   "prompt_tokens": 34
  },
  "modelId": "@cf/baai/bge-reranker-base",
  "results": [
   {
    "index": 0,
    "relevance_score": 0.9997
   },
   {
    "index": 1,
    "relevance_score": 0.00004
   }
  ],
  "truncatedDocuments": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/quickbuild-reranker-bge-document-reranking-api-aa91626c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from quickbuild.quynguyenbac.workers.dev](https://www.zero.xyz/host/quickbuild.quynguyenbac.workers.dev/llms.txt)
