# Agent402 Cohere Rerank via x402

> Agent402 Cohere Rerank via x402 is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

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

## Facts

- Endpoint: POST https://agent402.tools/v1/rerank
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-cohere-rerank-via-x402-6c110fa7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FMAsOflbiT3GnkNbSldm_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-cohere-rerank-via-x402-6c110fa7 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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).

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-cohere-rerank-via-x402-6c110fa7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
