Jina AI Reranker API

Re-rank search results by relevance using Jina AI's reranker models to improve the quality of retrieved documents.

OpenAPI Specification

jina-ai-reranker-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Jina AI Reranker API
  description: >-
    Re-rank a list of candidate documents against a query using Jina AI's
    reranker models. Returns scored, ordered results to improve the relevance
    of retrieved documents in RAG and search pipelines.
  version: '1.0'
  contact:
    name: Jina AI
    url: https://jina.ai
servers:
  - url: https://api.jina.ai/v1
    description: Jina AI production API
security:
  - BearerAuth: []
tags:
  - name: Reranker
    description: Cross-encoder reranking
paths:
  /rerank:
    post:
      tags:
        - Reranker
      summary: Rerank documents against a query
      description: >-
        Score and reorder a set of candidate documents by relevance to the
        provided query, optionally returning the top N results.
      operationId: rerank
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RerankRequest'
      responses:
        '200':
          description: Reranked results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RerankResponse'
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
  schemas:
    RerankRequest:
      type: object
      required:
        - model
        - query
        - documents
      properties:
        model:
          type: string
          enum:
            - jina-reranker-v3
            - jina-reranker-v2-base-multilingual
            - jina-colbert-v2
            - jina-reranker-m0
        query:
          type: string
          description: Search query
        documents:
          type: array
          description: Candidate documents to rerank
          items:
            oneOf:
              - type: string
              - type: object
                properties:
                  text:
                    type: string
                  image:
                    type: string
        top_n:
          type: integer
          description: Maximum number of results to return
        return_documents:
          type: boolean
          description: Whether to include document content in response
    RerankResponse:
      type: object
      properties:
        model:
          type: string
        usage:
          type: object
          properties:
            total_tokens:
              type: integer
        results:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              relevance_score:
                type: number
                format: float
              document:
                type: object
                properties:
                  text:
                    type: string