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

# POST /v1/rerank

> Available at the instance root or under a provider/namespace prefix. Shared paths select the wire dialect from client headers; without dialect evidence, the first listed route wins.



## OpenAPI

````yaml /generated/openapi.json post /v1/rerank
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /v1/rerank:
    post:
      tags:
        - Forwarding
      summary: POST /v1/rerank
      description: >-
        Available at the instance root or under a provider/namespace prefix.
        Shared paths select the wire dialect from client headers; without
        dialect evidence, the first listed route wins.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Input_RerankRequestBody'
        required: true
      responses:
        2XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_RerankResponseBody'
          description: Successful protocol response
        default:
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Output_Envelope'
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_ErrorDetail'
                    required:
                      - error
                    type: object
                  - allOf:
                      - $ref: '#/components/schemas/Output_ErrorEvent'
                      - properties:
                          type:
                            const: error
                        required:
                          - type
                        type: object
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_GenerateContentError'
                    required:
                      - error
                    type: object
            text/plain:
              schema:
                type: string
          description: Gateway or upstream error
components:
  schemas:
    Input_RerankRequestBody:
      additionalProperties: true
      properties:
        documents:
          items:
            $ref: '#/components/schemas/Input_RerankDocumentInput'
          type: array
        model:
          type: string
        provider:
          anyOf:
            - $ref: '#/components/schemas/Input_ProviderPreferences'
            - type: 'null'
        query:
          type: string
        top_n:
          format: int64
          type:
            - integer
            - 'null'
      required:
        - model
        - query
        - documents
      type: object
    Output_RerankResponseBody:
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - 'null'
        model:
          type: string
        provider:
          type:
            - string
            - 'null'
        results:
          items:
            $ref: '#/components/schemas/Output_RerankResult'
          type: array
        usage:
          anyOf:
            - $ref: '#/components/schemas/Output_RerankUsage'
            - type: 'null'
      required:
        - model
        - results
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
      required:
        - message
      type: object
    Output_ErrorEvent:
      additionalProperties: true
      properties:
        error:
          $ref: '#/components/schemas/Output_StreamError'
        request_id:
          type:
            - string
            - 'null'
      required:
        - error
      type: object
    Output_GenerateContentError:
      additionalProperties: true
      properties:
        code:
          format: int64
          type: integer
        details:
          items: true
          type:
            - array
            - 'null'
        message:
          type: string
        status:
          type:
            - string
            - 'null'
      required:
        - code
        - message
      type: object
    Input_RerankDocumentInput:
      anyOf:
        - type: string
        - $ref: '#/components/schemas/Input_RerankDocument'
    Input_ProviderPreferences:
      additionalProperties: true
      properties:
        allow_fallbacks:
          type:
            - boolean
            - 'null'
        data_collection:
          anyOf:
            - $ref: '#/components/schemas/Input_DataCollection'
            - type: 'null'
        enforce_distillable_text:
          type:
            - boolean
            - 'null'
        ignore:
          items:
            type: string
          type:
            - array
            - 'null'
        max_price:
          anyOf:
            - $ref: '#/components/schemas/Input_MaxPrice'
            - type: 'null'
        only:
          items:
            type: string
          type:
            - array
            - 'null'
        order:
          items:
            type: string
          type:
            - array
            - 'null'
        preferred_max_latency:
          anyOf:
            - $ref: '#/components/schemas/Input_PreferredCutoff'
            - type: 'null'
        preferred_min_throughput:
          anyOf:
            - $ref: '#/components/schemas/Input_PreferredCutoff'
            - type: 'null'
        quantizations:
          items:
            $ref: '#/components/schemas/Input_Quantization'
          type:
            - array
            - 'null'
        require_parameters:
          type:
            - boolean
            - 'null'
        sort:
          anyOf:
            - $ref: '#/components/schemas/Input_ProviderSort'
            - type: 'null'
        zdr:
          type:
            - boolean
            - 'null'
      type: object
    Output_RerankResult:
      additionalProperties: true
      properties:
        document:
          $ref: '#/components/schemas/Output_RerankDocument'
        index:
          format: int64
          type: integer
        relevance_score:
          type: number
      required:
        - index
        - relevance_score
        - document
      type: object
    Output_RerankUsage:
      additionalProperties: true
      properties:
        cost:
          type:
            - number
            - 'null'
        search_units:
          format: int64
          type:
            - integer
            - 'null'
        total_tokens:
          format: int64
          type:
            - integer
            - 'null'
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Output_StreamError:
      additionalProperties: true
      properties:
        message:
          type: string
        type:
          $ref: '#/components/schemas/Output_StreamErrorType'
      required:
        - type
        - message
      type: object
    Input_RerankDocument:
      additionalProperties: true
      properties:
        image:
          type:
            - string
            - 'null'
        text:
          type:
            - string
            - 'null'
      type: object
    Input_DataCollection:
      enum:
        - deny
        - allow
      type: string
    Input_MaxPrice:
      additionalProperties: true
      properties:
        audio:
          type:
            - string
            - 'null'
        completion:
          type:
            - string
            - 'null'
        image:
          type:
            - string
            - 'null'
        prompt:
          type:
            - string
            - 'null'
        request:
          type:
            - string
            - 'null'
      type: object
    Input_PreferredCutoff:
      anyOf:
        - type: number
        - $ref: '#/components/schemas/Input_PercentileCutoffs'
    Input_Quantization:
      enum:
        - int4
        - int8
        - fp4
        - mxfp4
        - nvfp4
        - fp6
        - fp8
        - mxfp8
        - fp16
        - bf16
        - fp32
        - unknown
      type: string
    Input_ProviderSort:
      anyOf:
        - $ref: '#/components/schemas/Input_ProviderSortBy'
        - $ref: '#/components/schemas/Input_ProviderSortConfig'
    Output_RerankDocument:
      additionalProperties: true
      properties:
        image:
          type:
            - string
            - 'null'
        text:
          type:
            - string
            - 'null'
      type: object
    Output_StreamErrorType:
      enum:
        - api_error
        - authentication_error
        - billing_error
        - invalid_request_error
        - not_found_error
        - overloaded_error
        - permission_error
        - rate_limit_error
        - timeout_error
        - conflict_error
        - request_too_large
      type: string
    Input_PercentileCutoffs:
      additionalProperties: true
      properties:
        p50:
          type:
            - number
            - 'null'
        p75:
          type:
            - number
            - 'null'
        p90:
          type:
            - number
            - 'null'
        p99:
          type:
            - number
            - 'null'
      type: object
    Input_ProviderSortBy:
      enum:
        - price
        - throughput
        - latency
        - exacto
      type: string
    Input_ProviderSortConfig:
      additionalProperties: true
      properties:
        by:
          anyOf:
            - $ref: '#/components/schemas/Input_ProviderSortBy'
            - type: 'null'
        partition:
          anyOf:
            - $ref: '#/components/schemas/Input_ProviderPartition'
            - type: 'null'
      type: object
    Input_ProviderPartition:
      enum:
        - model
        - none
      type: string
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey

````

## Related topics

- [Routing & Endpoints](https://gproxy.leenhawk.com/reference/routing-table.md)
- [POST /v1/conversations](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1conversations.md)
- [POST /v1/decisions](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1decisions.md)
- [POST /v1/embeddings](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1embeddings.md)
- [POST /v1/files](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1files.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.