rerank

Rerank documents by relevance to a query.

Billing: a model priced per request (unit: requests) is charged per search unit the provider reports, or for one unit when it reports none. A model priced per token is charged on the input tokens the provider reports.

usage carries what the gateway metered: the provider's tokens, the search units billed when the model is priced per request, and, when the request was priced, cost_usd and pricing_source as a completion's usage does. meta is the provider's own billing report, unchanged.

Authentication modes:

  • Master key + user field: Use specified user (must exist)
  • API key + user field: Use specified user (must exist)
  • API key without user field: Use the shared "default" user
post/api/v1/rerank

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header Otari-Key
    • API key in header x-api-key

Request body

documentsstring[] required

List of document strings to rerank

max_tokens_per_docinteger nullable

Per-document truncation limit

modelstring required

Provider-prefixed model ID, e.g. 'cohere:rerank-v3.5'

querystring required

The search query to rerank documents against

top_ninteger nullable

Maximum number of results to return

userstring nullable

User ID for usage attribution

Response

Successful Response

idstring nullable

Provider-assigned response ID

modelstring nullable

The model that served the request

Changes

    • breaking

      the response's body type changed from no type to object for status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the optional property to the response with the status