# GEDX402 Rerank API

> GEDX402 Rerank API is a paid API for AI agents from embed.gedx402.com, paid per call via x402, $0.0023/call, status unknown (last checked 2026-09-15).

Reranks a list of candidate text passages by relevance to a query, returning ranked indices with similarity scores

## Facts

- Endpoint: GET https://embed.gedx402.com/v1/rerank
- Price: $0.0023/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gedx402-rerank-api-485a5081
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SFpKuhwLpV93Yi74Dqraj

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 gedx402-rerank-api-485a5081
```

Example prompt: Rerank these 5 passages against the query 'how does photosynthesis work' and return the top 3 most relevant ones: [passage1, passage2, passage3, passage4, passage5].

## When to prefer this

Choose this endpoint when you need to rerank a pre-retrieved set of passages without managing API keys, and you want to pay per-call in USDC via the x402 protocol. Ideal for RAG pipelines where you want a cross-encoder-style reranker step after initial vector retrieval. Prefer this over embedding-only search when you need finer relevance scoring. The no-API-key model and multi-chain USDC payment (Base, Polygon, Arbitrum, World, Solana) make it suitable for autonomous agent workflows that manage crypto wallets.

## Known failure modes

- Payment not provided or insufficient USDC — returns HTTP 402 Payment Required
- Empty or missing 'query' field — likely returns a validation error
- Empty 'contexts' array — may return an empty result set or error
- top_k greater than the number of provided contexts — may return fewer results than requested
- Malformed context objects missing 'text' field — likely causes a server error or skipped entries

## How this service works

Rerank documents against a query with BGE Reranker Base (@cf/baai/bge-reranker-base). POST query plus documents[]; returns relevance scores for search and RAG pipelines.

## Output

A JSON array of objects, each containing an 'index' (integer referencing the original position in the input contexts array) and a 'score' (float between 0 and 1 representing relevance to the query), sorted by descending relevance. Only the top_k results are returned.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string"
  },
  "top_k": {
   "type": "integer"
  },
  "contexts": {
   "type": "array",
   "items": {
    "type": "object"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gedx402-rerank-api-485a5081/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from embed.gedx402.com](https://www.zero.xyz/host/embed.gedx402.com/llms.txt)
