v1

latestOpenAPI 3.1.02026-07-26106201349.6 KB

Rerank documents

Rerank documents for a query using relevance scoring

post/rerank

Request body

modelstring nullable

The name of the reranker model to use.

querystring required

The search query to use for reranking documents.

documentsstring[] required

A list of documents to rerank. Each document is a string.

top_ninteger nullable

The number of most relevant documents to return. If not specified, all documents are returned.

return_documentsboolean

Whether to return the document text in the response. Defaults to true.

taskstring nullable

Optional task description to guide the reranking process.

Example request

{
  "model": "accounts/fireworks/models/qwen3-reranker-8b",
  "query": "What is machine learning?",
  "documents": [
    "Machine learning is a subset of AI.",
    "The weather is sunny today."
  ],
  "task": "Given a web search query, retrieve relevant passages that answer the query"
}

Response

OK

object'list' required

The object type, which is always "list".

modelstring required

The name of the model used for reranking.