Skip to main content
POST /api/v1/rerank scores each document against a query and returns them from most to least relevant. List the available models with GET /api/v1/rerank-models.

Request

Other fields are rejected. Streaming isn’t supported. Each query and document pair can use up to 32,768 tokens, and a request up to 300,000. These checks are a conservative estimate based on text size in bytes.

Response

Results are sorted by descending score, and tied scores keep their original order.

Pricing

$0.05 per million input tokens. Every document is scored and billed, including those top_n leaves out. The x-nanogpt-cost-usd response header shows the cost of the request.

Errors