Jina AI Reranker API

Cross-encoder reranking

OpenAPI Specification

jina-ai-reranker-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Jina AI Embeddings Batch Reranker API
  description: Generate high-quality multimodal embeddings for text, image, and code inputs using Jina AI's state-of-the-art embedding models. Supports synchronous embedding requests and batch jobs for large workloads.
  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:
  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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key