Document rerank — AgentSky

Document rerank

Overview

Scores and orders documents by relevance to a query, using the selected reranker.

Ordered document indexes with relevance scores and model information.

Input

These go in the input object of the run request.

Field Type Required Description
query string Yes Query to rank against.
documents array Yes One to 1000 nonempty document strings.
top_k integer No Maximum number of results, up to 100.
Minimum: 1
Maximum: 100
model string No Reranking model.
Allowed: rerank-3, rerank-3-lite, rerank-2.5, rerank-2.5-lite
Default: "rerank-3"

Requests up to 1 MB.

Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \ 
  -H "authorization: Bearer $AGENTSKY_API_KEY" \ 
  -H "content-type: application/json" \ 
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \ 
  -d '{"provider":"rerank","endpoint":"voyage","input":{"query":"API gateways","documents":["An API gateway routes requests.","A recipe for bread."]}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.

Pricing

— per token using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

Questions

What does Document rerank do?

What does Document rerank take?

What are the limits on Document rerank?

How do I retry safely and check the final charge?