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

# Document Reranking

> 根据查询对文档列表进行相关性重排序



## OpenAPI

````yaml post /v1/rerank
openapi: 3.1.0
info:
  title: UToken API
  version: 1.0.0
  description: Complete UToken API Reference Documentation
servers:
  - url: https://utoken.yoostudio.ai
    description: Production
security: []
tags:
  - name: Images / Native Gemini Format
  - name: Images / Native OpenAI Format
  - name: Images / Qwen OpenAI Compatible Format
  - name: Realtime Voice
  - name: Content Moderation
  - name: Text Embeddings
  - name: Unimplemented / Fine-tuning
  - name: Unimplemented / File Management
  - name: Models / List Models
  - name: Chat Completions
  - name: Chat Completions / Native Gemini Format
  - name: Chat Completions / Native OpenAI Format
  - name: Text Completions
  - name: Video Generation
  - name: Video Generation / Sora Format
  - name: Video Generation / Jimeng (Dreamina) Format
  - name: Video Generation / Kling AI Format
  - name: Document Reranking
  - name: Audio Processing
  - name: Audio Processing / Native OpenAI Format
paths:
  /v1/rerank:
    post:
      tags:
        - Document Reranking
      summary: Document Reranking
      description: Relevance-rerank a list of documents based on a query
      operationId: creatererank
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - query
                - documents
              properties:
                model:
                  type: string
                  examples:
                    - rerank-english-v2.0
                query:
                  type: string
                  description: Query text
                documents:
                  type: array
                  items:
                    oneOf:
                      - type: string
                      - type: object
                        properties: {}
                        x-apifox-orders: []
                  description: List of documents to rerank
                top_n:
                  type: integer
                  description: Return top N results
                return_documents:
                  type: boolean
                  default: false
              x-apifox-orders:
                - model
                - query
                - documents
                - top_n
                - return_documents
      responses:
        '200':
          description: Success - Documents reranked
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        relevance_score:
                          type: number
                        document:
                          type: object
                          properties: {}
                          x-apifox-orders: []
                      x-apifox-orders:
                        - index
                        - relevance_score
                        - document
                  meta:
                    type: object
                    properties: {}
                    x-apifox-orders: []
                x-apifox-orders:
                  - id
                  - results
                  - meta
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Use Bearer Token authentication
        Format: Authorization: Bearer sk-xxxxxx

````