Rerank

POST

Rerank sorts text inputs by semantic relevance to a specified query.

Request

This endpoint expects an object.
modelstringRequired

The model to use for reranking.

querystringRequired

The query to rank against.

documentslist of stringsRequired

Array of documents to rank.

return_documentsbooleanOptionalDefaults to false

Boolean setting whether to return documents in output.

Response

Successful response.

idstringOptional

Unique ID for the rerank response.

objectstringOptional

Type of object (list).

createdintegerOptional

Timestamp of when the rerank response was created.

modelstringOptional

The rerank model used.

resultslist of objectsOptional

The set of rankings.

Errors