Pular para o conteúdo principal
POST
Create rerank
Guia relacionado: guia de Rerank e moderações. Consulte o guia de Rerank e moderações para um passo a passo com exemplos.

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Corpo

application/json

input

query
string
obrigatório

The search query

documents
string[]
obrigatório

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.

model
string
obrigatório

The identifier of the model to use

Exemplo:

"cohere/rerank-v4.0-pro"

top_n
integer

The number of most relevant documents or indices to return, defaults to the length of the documents

Intervalo obrigatório: x >= 1
return_documents
boolean

Whether to return the documents in the response

filename
string | null

The filename of the document to rerank

name
string

The name to display on the trace. If not specified, the default system name will be used.

fallback_on_codes
integer[]

HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].

Maximum array length: 20
Intervalo obrigatório: 400 <= x <= 599
fallbacks
object[]

Array of fallback models to use if primary model fails

retry
object

Retry configuration for the request

cache
object

Cache configuration for the request.

load_balancer
object

Load balancer configuration for the request.

timeout
object

Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.

plugins
PII redaction plugin · object[]

Request-scoped transforms applied to the text exchanged with the model. Currently supports pii_redaction, which replaces PII with placeholders before the provider sees it and restores the original values in the response.

orq
object

Resposta

Returns the reranked documents.

object
enum<string>
obrigatório
Opções disponíveis:
list
results
object[]
obrigatório

An ordered list of ranked documents

id
string

A unique identifier for the rerank.

usage
object