{"uid":"cap_WCUDQH3h2m9FMfIxl04be","slug":"quickbuild-reranker-bge-document-reranking-api-aa91626c","name":"QuickBuild Reranker — BGE Document Reranking API","description":"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.","url":"https://quickbuild.quynguyenbac.workers.dev/v1/rerank?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JpHq9mVqSHzq4rtbUWj6n","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Reranks a list of documents by relevance to a query using BGE reranker models, returning scored results ordered by relevance.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"RAG pipeline context window optimization","prompt":"I have 20 retrieved text chunks from my vector search and the query is 'what are the side effects of ibuprofen?' — can you rerank them with bge-reranker-base and return only the top 5 most relevant ones with their relevance scores?"},{"title":"Search result re-ordering for e-commerce","prompt":"I have a list of 15 product descriptions and my user searched for 'waterproof hiking boots for winter'. Rerank all of them by relevance to that query using bge-m3 and include the document text in the results."},{"title":"QA passage selection from docs","prompt":"Given the question 'what is the refund policy for digital products?' and these 10 support article excerpts, use the reranker to score each one and tell me which are most relevant so I know which to include in my answer."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:58.364Z","isFirstParty":false,"canonicalSlug":"quickbuild-reranker-bge-document-reranking-api-aa91626c"}