Skip to main content
POST

Authorizations

Authorization
string
header
default:default
required

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

Body

application/json
model
required

The model to be used for the rerank request.

See all of Together AI's rerank models

Available options:
Salesforce/Llama-Rank-v1
Example:

"Salesforce/Llama-Rank-V1"

query
string
required

The search query to be used for ranking.

Example:

"What animals can I find near Peru?"

documents
required

List of documents, which can be either strings or objects.

Example:
top_n
integer

The number of top results to return.

Example:

2

return_documents
boolean

Whether to return supplied documents with the response.

Example:

true

rank_fields
string[]

List of keys in the JSON Object document to rank by. Defaults to use all supplied keys for ranking.

Example:

Response

200

object
any
required

The object type, which is always rerank.

model
string
required

The model to be used for the rerank request.

Example:

"salesforce/turboranker-0.8-3778-6328"

results
object[]
required
Example:
id
string

Request ID

Example:

"9dfa1a09-5ebc-4a40-970f-586cb8f4ae47"

usage
object | null
Example: