Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Rerank request input

Example Usage

import { CreateRerankRequestBody } from "@openrouter/sdk/models/operations";

let value: CreateRerankRequestBody = {
  documents: [
    "Paris is the capital of France.",
    "Berlin is the capital of Germany.",
  ],
  model: "cohere/rerank-v3.5",
  query: "What is the capital of France?",
};

Fields

FieldTypeRequiredDescriptionExample
documentsstring[]:heavy_check_mark:The list of documents to rerank[
“Paris is the capital of France.”,
“Berlin is the capital of Germany.”
]
modelstring:heavy_check_mark:The rerank model to usecohere/rerank-v3.5
providermodels.ProviderPreferences:heavy_minus_sign:N/A{"allow_fallbacks": true}
querystring:heavy_check_mark:The search query to rerank documents againstWhat is the capital of France?
topNnumber:heavy_minus_sign:Number of most relevant documents to return3