> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateRerankRequestBody

Rerank request input

## Example Usage

```typescript theme={null}
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

| Field | Type | Required | Description | Example |
| - | - | - | - | - |
| `documents` | *operations.Document*\[] | ✔️ | The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models. | \[ "Paris is the capital of France.", "Berlin is the capital of Germany." ] |
| `model` | *string* | ✔️ | The rerank model to use | cohere/rerank-v3.5 |
| `provider` | [models.ProviderPreferences](../../models/providerpreferences.mdx) | ➖ | N/A | \{ "allow\_fallbacks": true } |
| `query` | *string* | ✔️ | The search query to rerank documents against | What is the capital of France? |
| `sessionId` | *string* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 |
| `topN` | *number* | ➖ | Number of most relevant documents to return | 3 |
| `trace` | [models.TraceConfig](../../models/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace\_id, trace\_name, span\_name, generation\_name, parent\_span\_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{ "trace\_id": "trace-abc123", "trace\_name": "my-app-trace" } |
| `user` | *string* | ➖ | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 |
