{"uid":"cap_FMAsOflbiT3GnkNbSldm_","slug":"agent402-cohere-rerank-via-x402-6c110fa7","name":"Agent402 Cohere Rerank via x402","description":"Rerank documents against a query over x402 - the Cohere /rerank wire ({query, documents[], top_n} -> results with relevance_score), served by cohere/rerank-v3.5, $0.002 per call in USDC, no API key, no signup. Up to 50 documents (1,600 chars each, 40k total) and a 500-char query per call. Deterministic, so a byte-identical repeat within 10 minutes is served FREE from cache (X-Cache: hit; opt out with cache:false).","url":"https://agent402.tools/v1/rerank","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"cache":{"type":"boolean","description":"Optional - false disables the default-on response cache"},"query":{"type":"string","description":"The search query (max 500 chars)"},"top_n":{"type":"integer","description":"Optional - return only the top N results"},"documents":{"type":"array","items":{"type":"string"},"description":"Documents to rank (1-50 strings, 1,600 chars each, 40k total)"}}},"responseSchema":{"type":"json","example":{"id":"gen-rerank-…","model":"rerank-v3.5","usage":{"search_units":1},"results":[{"index":0,"document":{"text":"Paris is the capital of France."},"relevance_score":0.89},{"index":1,"document":{"text":"Berlin is the capital of Germany."},"relevance_score":0.15}]}},"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_jKnkv79mOZVJZjUunC2O6","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 Cohere rerank-v3.5, returning results with relevance scores, paid per-call in USDC over x402","exampleAgentPrompt":"Rerank these 10 document chunks by how relevant they are to the query 'climate change effects on agriculture' and return the top 3 most relevant ones.","exampleUseCases":[{"title":"RAG pipeline passage selection","prompt":"I have 30 retrieved text chunks from my knowledge base and the user asked about 'how to handle database connection timeouts in Python' — rerank them and give me only the top 5 most relevant passages to pass to the LLM."},{"title":"E-commerce search result reordering","prompt":"Here are 20 product descriptions from our catalog. The customer searched for 'lightweight waterproof hiking boots'. Rerank them by relevance and return all results with their relevance scores so I can reorder the search page."},{"title":"FAQ routing for customer support","prompt":"Given this customer message 'my payment keeps getting declined but my card is valid', rerank these 15 FAQ entries by how well they answer the question and show me the top 4."}],"resultDescription":"Returns a list of reranked results, each containing the original document index and a relevance_score (float between 0 and 1) indicating how semantically relevant the document is to the query. If top_n is specified, only the top N results are returned. Results are ordered from most to least relevant.","failureModes":["More than 50 documents submitted — request rejected","Total document character count exceeds 40,000 chars — request rejected","Query exceeds 500 characters — request rejected","Payment failure or insufficient USDC balance — 402 response with payment details","Empty documents array — likely returns empty results or error","Individual document exceeds 1,600 characters — may be truncated or rejected"],"whenToPreferThis":"Choose this endpoint when you need semantic reranking powered by Cohere rerank-v3.5 but want to avoid API key management and monthly subscriptions — paying only $0.002 USDC per call via x402. Ideal for AI agents in RAG pipelines that need to select the most relevant chunks before passing to an LLM, or for improving search result ordering without provisioning Cohere credentials. Best when document set is under 50 items and total content under 40k characters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T13:05:32.045Z","isFirstParty":false}