Rerank documents by relevance: reranker for RAG
ai_rerankOrder up to 50 documents by how well each answers a query, with a relevance score from 0 to 1 (BAAI bge-reranker-base, a cross-encoder). Send documents as a JSON array or one per line; each is read up to 2,000 characters, 40,000 in all. Returns the original index, score and text, best first; top_n keeps only the best. Also available in the Cohere-style shape at /v1/rerank. Use to pick what a model reads after search or vector retrieval. Price $0.002/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | What the documents should answer (up to 2,000 characters) | |
| top_n | No | Keep only the best N results (default all) | |
| documents | Yes | Up to 50 documents: a JSON array of strings, or one per line |