POST /v2/rerank

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

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

X-Client-Name String No

The name of the project that is making the request.

Request body fields

Name Type Required Description
documents[] Array Yes

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.

query String Yes

The search query

max_tokens_per_doc Integer No

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

model String Yes

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

top_n Integer No

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

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.