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

# Rerank

> Rerank documents based on relevance to a query

The Rerank endpoint helps improve search quality by reordering documents based on their relevance to a query.

<Card title="Authentication Required" icon="key" href="/api-reference/endpoint/get-api">
  Learn how to get your API key to use this endpoint
</Card>

### Models

Available models for reranking:

* `rerank-english-v2.0`
* `rerank-english-v3.0`
* `rerank-multilingual-v2.0`
* `rerank-multilingual-v3.0`

### Example Request

```json theme={null}
{
  "model": "jina-reranker-v2-base-multilingual",
  "query": "Organic skincare products for sensitive skin",
  "top_n": 3,
  "documents": [
    "Organic skincare for sensitive skin with aloe vera and chamomile",
    "New makeup trends focus on bold colors and innovative techniques",
    "Natural remedies for skin inflammation and redness"
  ]
}
```


## OpenAPI

````yaml POST /v1/rerank
openapi: 3.0.1
info:
  title: TaamCloud API
  description: >-
    A collection of AI services including chat, embeddings, reranking, and media
    generation
  version: 1.0.0
servers:
  - url: https://api.gately.ai
    description: Main API server
  - url: https://uploud.taam.cloud
    description: File Processing server
security:
  - bearerAuth: []
paths:
  /v1/rerank:
    post:
      tags:
        - Reranking
      summary: Rerank documents
      description: Reorder a list of documents based on their relevance to a query
      operationId: rerank
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RerankRequest'
            examples:
              Standard:
                value:
                  model: mixr-v1
                  query: What are the health benefits of exercise?
                  documents:
                    - >-
                      Exercise improves cardiovascular health and reduces
                      stress.
                    - Proper nutrition is essential for overall well-being.
                    - Sleep quality affects mental and physical performance.
                  top_n: 2
      responses:
        '200':
          description: Successful response
components:
  schemas:
    RerankRequest:
      type: object
      required:
        - model
        - query
        - documents
      properties:
        model:
          type: string
        query:
          type: string
        top_n:
          type: integer
        documents:
          type: array
          items:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Enter your API key prefixed with 'Bearer '

````