Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Rerank response containing ranked results

Example Usage

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

let value: CreateRerankResponseBody = {
  model: "cohere/rerank-v3.5",
  results: [
    {
      document: {
        text: "Paris is the capital of France.",
      },
      index: 0,
      relevanceScore: 0.98,
    },
  ],
};

Fields

FieldTypeRequiredDescriptionExample
idstring:heavy_minus_sign:Unique identifier for the rerank response (ORID format)gen-rerank-1234567890-abc
modelstring:heavy_check_mark:The model used for rerankingcohere/rerank-v3.5
providerstring:heavy_minus_sign:The provider that served the rerank requestCohere
resultsoperations.Result[]:heavy_check_mark:List of rerank results sorted by relevance[
{"document": {"text": "Paris is the capital of France."},
“index”: 0,
“relevance_score”: 0.98
}
]
usageoperations.CreateRerankUsage:heavy_minus_sign:Usage statistics{"search_units": 1,"total_tokens": 150}