{"uid":"cap_QAGVV_a5_l0MEwq2hvTF6","slug":"tanship-payai-console-rerank-api-x402-8fcc47bf","name":"Tanship PayAI Console — Rerank API (x402)","description":"Payment-gated AI and browser automation API using the x402 protocol. All /v1/* endpoints require USDC payment on Base (eip155:8453) via x402 v2 exact scheme.","url":"https://x402.tanship.dev/v1/ai/rerank","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_vn-Dz6rIf6-JkVE1bJh-1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","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 or passages by relevance to a query using AI, gated by USDC micropayment via the x402 protocol on Base.","exampleAgentPrompt":"I have a list of 10 retrieved passages about climate change and I need them reranked by how relevant they are to the question 'what are the main causes of rising sea levels?' — can you use the Tanship reranker to sort them for me?","exampleUseCases":[{"title":"RAG pipeline context optimization","prompt":"I have these 20 retrieved document chunks from my vector DB and I need them reranked by relevance to the user question 'how do I configure TLS on nginx?' — rerank them so I can pass the top 5 into my LLM context window."},{"title":"Search result quality improvement","prompt":"Our e-commerce search returned 15 product descriptions for the query 'lightweight running shoes for trails' — can you rerank them by actual relevance so we surface the best matches first?"},{"title":"Candidate answer selection for QA","prompt":"I have 8 candidate answers to the question 'what is the capital gains tax rate for 2024?' — can you rerank them by how accurately and directly they answer the question so I know which one to use?"}],"resultDescription":"A reranked list of the input documents ordered by their relevance score relative to the query, typically including a relevance or confidence score for each document and their new rank positions.","failureModes":["Missing or malformed 'input' body returns a 400 validation error","Payment not included or insufficient USDC triggers a 402 Payment Required response with x402 payment details","Empty document list or missing query causes processing failure","Unsupported bodyType value results in rejection","Base network payment transaction failure blocks request execution"],"whenToPreferThis":"Choose this endpoint when you need semantic AI-powered reranking in a pay-per-use micropayment model without API key management, especially in autonomous agent pipelines that use x402 on Base for on-chain USDC payments. Ideal for RAG pipelines, search quality improvement, or any scenario where you retrieve a candidate set and need to reorder by true relevance at low per-call cost ($0.003 USDC).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:42:57.721Z","isFirstParty":false}