CreateRerankRequestBody - TypeScript SDK

CreateRerankRequestBody type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Rerank request input

Example Usage

1import { CreateRerankRequestBody } from "@openrouter/sdk/models/operations";
2
3let value: CreateRerankRequestBody = {
4 documents: [
5 "Paris is the capital of France.",
6 "Berlin is the capital of Germany.",
7 ],
8 model: "cohere/rerank-v3.5",
9 query: "What is the capital of France?",
10};

Fields

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