# Animica Rerank API

> Animica Rerank API is a paid API for AI agents from animica.dev, paid per call via x402, $0.001794/call, status unknown (last checked 2026-09-13).

Reranks a list of candidate documents by relevance to a query, returning scored and reasoned results

## Facts

- Endpoint: POST https://animica.dev/x402/rerank
- Price: $0.001794/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/animica-rerank-api-9697b113
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mOGwFBTAnvPulNmmBLagh

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 animica-rerank-api-9697b113 -d '<json body>'
```

Example prompt: I have these 10 retrieved passages and I want to know which 3 are most relevant to the question 'What are the side effects of ibuprofen?' — can you rerank them and give me the scores and reasons?

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call reranker to improve precision in a RAG or search pipeline without managing your own reranking model or API keys. It is especially useful for AI agents that need fast, scored, reasoned rankings of up to 50 documents against a free-text query, and where micropayment-based access (x402/USDC) is acceptable. Prefer alternatives if you need batch processing of thousands of documents, deterministic scoring, or integration with a specific embedding provider.

## Known failure modes

- Fewer than 2 documents provided — schema requires at least 2 strings in the documents array
- More than 50 documents provided — array is capped at 50 items
- Missing required fields (query or documents) returns a 400-level error
- Payment failure via x402 protocol results in a 402 Payment Required response
- Empty or very short documents may produce low-confidence scores and generic reasons

## How this service works

Give a query and up to 50 candidate snippets; get the top N by relevance with a score and a one-line reason. Indexes are returned so you can map straight back to your own objects without string matching. Priced per call. For high-volume use, buy prepaid credits (POST /x402/credits/buy) and send X-Animica-Credits on each request — no settlement, no gas, no per-call payment round trip. Paying in ANM on the animica:1 lane is also ~25% cheaper because we sponsor no gas there.

## Output

A JSON object containing a ranked array of results — each item includes the original document index, a float relevance score, and a human-readable reason explaining the ranking — plus the name of the model used for reranking.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string"
  },
  "top_k": {
   "type": "integer",
   "description": "how many to return (default 5)"
  },
  "documents": {
   "type": "array",
   "description": "2..50 strings"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/animica-rerank-api-9697b113/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from animica.dev](https://www.zero.xyz/host/animica.dev/llms.txt)
