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 model: "cohere/rerank-v3.5",
5 query: "What is the capital of France?",
6 documents: [
7 "Paris is the capital of France.",
8 "Berlin is the capital of Germany.",
9 ],
10};

Fields

FieldTypeRequiredDescriptionExample
modelstring✔️The rerank model to usecohere/rerank-v3.5
querystring✔️The search query to rerank documents againstWhat is the capital of France?
documentsstring[]✔️The list of documents to rerank[
“Paris is the capital of France.”,
“Berlin is the capital of Germany.”
]
topNnumberNumber of most relevant documents to return3
providermodels.ProviderPreferencesProvider routing preferences for the request.