{"uid":"cap_skjjEl2_U9hGLSk7qJUa8","slug":"document-rerank-426c47e3","name":"document-rerank","description":"Rank up to 50 documents by relevance to a query in a single call - each document returned with its relevance probability, sorted highest first. Try GET /rank/sample.","url":"https://x402.agentindex.world/rank?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"query":{"type":"string","description":"The query to rank documents against."},"documents":{"type":"array","items":{"type":"string"},"maxItems":50,"minItems":1,"description":"Up to 50 documents to rank by relevance to the query. Each truncated to 2000 characters before scoring."}}},"responseSchema":{"type":"json","example":{"documents":[{"score":1,"document":"A guide to RESTful resource naming conventions and correct HTTP verb usage."},{"score":0,"document":"A blog post comparing REST API versioning strategies: URL path, header, and query param versioning."},{"score":0,"document":"A recipe for chocolate cake with step-by-step baking instructions."}],"x402_receipt":{"upstream":"rerank","latency_ms":405,"model_served":"jev","price_paid_usdc":0}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_LygP1o5SuUabWOSnJKUIL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Ranks up to 50 documents by relevance to a query, returning each with a relevance probability score sorted highest first.","exampleAgentPrompt":"Rank these 10 passages by how relevant they are to the question 'what are the side effects of ibuprofen?' and give me back each one with its relevance score.","exampleUseCases":[{"title":"RAG pipeline reranking","prompt":"I retrieved 20 candidate chunks from my vector database for the query 'how does compound interest work' — can you rerank them by relevance so I only pass the top 3 to the LLM?"},{"title":"Search result quality filter","prompt":"I have 15 web snippets about 'electric vehicle tax credits 2024' and I need them sorted by relevance so the most useful ones appear first — can you score and rank them?"},{"title":"FAQ matching for customer support","prompt":"Given the user question 'how do I reset my password?', rank these 8 FAQ entries by how well they answer it, with relevance probabilities for each."}],"resultDescription":"A list of up to 50 documents returned in descending order of relevance, each accompanied by its relevance probability score (a float between 0 and 1), allowing the caller to select the top-N most relevant documents for downstream use.","failureModes":["Empty documents array returns a validation error","Documents exceeding 50 items are rejected","Each document truncated to 2000 characters silently before scoring, potentially losing context","Ambiguous or very short query strings may produce low-confidence uniform scores","Non-English queries or documents may yield degraded ranking quality"],"whenToPreferThis":"Choose this endpoint when you need a fast, pay-per-call document reranker without hosting your own cross-encoder model — ideal for RAG pipelines, retrieval post-processing, or any scenario where you have a candidate set of up to 50 text chunks and need them ordered by semantic relevance to a query. At $0.001 per call it is cost-effective for frequent reranking tasks and eliminates infrastructure overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T01:18:00.535Z","isFirstParty":false,"canonicalSlug":"document-rerank-426c47e3"}