Docs

Rerank

Order documents you already hold with the authenticated Scry rerank endpoint.

Request

POST /v1/scry/rerank accepts JSON with a non-empty query and documents, where each document has a unique id and non-empty text. A request carries 2 to 1,000 documents. Optional fields are instruction, tier, model, and top_n.

curl -X POST https://api.scry.io/v1/scry/rerank \
  -H "Authorization: Bearer $SCRY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"mechanistic interpretability","documents":[{"id":"a","text":"..."},{"id":"b","text":"..."}],"top_n":2}'

Tiers and model pins

The default tier is fast. The other tiers are quality and hosted. A model value pins one registered model and disables substitution. Without a model pin, a tier can move through its fallback chain when a lane is unavailable.

Response

The response returns ranked document IDs with zero-based rank values and scores when reranking succeeds. It also reports model_applied, tier_applied, reranked, timings, document and token usage, and cost. If every lane fails, the endpoint returns the input order with reranked: false, no scores, and a degraded_reason instead of failing the request.

Related docs