{"slug":"agent-data-tools-revmesh2074-workers-dev-ai-rerank-ac31fc","title":"Rerank documents by relevance","host":"agent-data-tools.revmesh2074.workers.dev","method":"GET","resource":"https://agent-data-tools.revmesh2074.workers.dev/ai/rerank","category":"search","description":"Rerank documents by relevance. Order 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, scor","price_listed":0.002,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":0,"reported_payers_30d":0,"networks":["eip155:137","eip155:42161","eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"method":"GET","queryParams":{"documents":"[\"France has hundreds of cheeses.\",\"Berlin is the capital of Germany.\",\"Paris is the capital and largest city of France.\"]","query":"What is the capital of France?"},"type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"method":{"enum":["GET"],"type":"string"},"queryParams":{"properties":{"documents":{"description":"Up to 50 documents: a JSON array of strings, or one per line","examples":["[\"France has hundreds of cheeses.\",\"Berlin is the capital of Germany.\",\"Paris is the capital and largest city of France.\"]"],"type":"string"},"query":{"description":"What the documents should answer (up to 2,000 characters)","examples":["What is the capital of France?"],"type":"string"},"top_n":{"description":"Keep only the best N results (default all)","examples":["2"],"type":"string"}},"required":["query","documents"],"type":"object"},"type":{"const":"http","type":"string"}},"required":["type","method"],"type":"object"},"output":{"properties":{"example":{"properties":{"clippedDocuments":{"type":"number"},"documents":{"type":"number"},"model":{"type":"string"},"query":{"type":"string"},"results":{"items":{"properties":{"document":{"type":"string"},"index":{"type":"number"},"relevance_score":{"type":"number"}},"type":"object"},"type":"array"}},"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Rerank documents by relevance. Order 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.","last_updated":"2026-10-25T16:31:11.56Z","schemes":["exact"]}