v51

latestOpenAPI 3.1.0proprietaryraw.githubusercontent.com2026-07-21411711.1 MB

Rerank API (v2)

This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.

post/v2/rerank

Headers

X-Client-Namestring

The name of the project that is making the request.

Request body

modelstring required

The identifier of the model to use, eg rerank-v3.5.

querystring required

The search query

documentsstring[] required

A list of texts that will be compared to the query. For optimal performance we recommend against sending more than 1,000 documents in a single request.

Note: long documents will automatically be truncated to the value of max_tokens_per_doc.

Note: structured data should be formatted as YAML strings for best performance.

top_ninteger

Limits the number of returned rerank results to the specified value. If not passed, all the rerank results will be returned.

max_tokens_per_docinteger

Defaults to 4096. Long documents will be automatically truncated to the specified number of tokens.

priorityinteger

Controls how early the request is handled. Lower numbers indicate higher priority (default: 0, the highest). When the system is under load, higher-priority requests are processed first and are the least likely to be dropped.

Response

OK

idstring