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

# Score text

> Score a query-document pair for relevance.



## OpenAPI

````yaml post /v1/inference/score
openapi: 3.1.0
info:
  title: SeekrFlow API
  description: SeekrFlow API Documentation
  termsOfService: http://www.seekr.com/support
  contact:
    name: Seekr API Support
    url: http://www.seekr.com/contact
    email: contact@seekr.com
  version: 5.48.1
servers:
  - url: https://flow.seekr.com
    description: SeekrBuild server base URL
security: []
paths:
  /v1/inference/score:
    post:
      tags:
        - Inference
      summary: Score query/document pairs
      operationId: route_v1_score_v1_inference_score_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScoreRequest'
            example:
              model: BAAI/bge-reranker-v2-m3
              queries: What is the capital of France?
              documents:
                - Paris is the capital of France.
                - The Eiffel Tower is in Paris.
        required: true
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScoreResponse'
        '400':
          description: Malformed request body, or `model` missing.
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        properties:
                          message:
                            type: string
                          type:
                            type: string
                          code:
                            type: integer
                          param:
                            type: string
                            nullable: true
                        type: object
                        required:
                          - message
                    type: object
                    required:
                      - error
                    title: StructuredError
                  - properties:
                      error:
                        type: string
                    type: object
                    required:
                      - error
                    title: SimpleError
                title: ErrorResponse
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        properties:
                          message:
                            type: string
                          type:
                            type: string
                          code:
                            type: integer
                          param:
                            type: string
                            nullable: true
                        type: object
                        required:
                          - message
                    type: object
                    required:
                      - error
                    title: StructuredError
                  - properties:
                      error:
                        type: string
                    type: object
                    required:
                      - error
                    title: SimpleError
                title: ErrorResponse
        '403':
          description: >-
            The requested model is not a base model and is not deployed for your
            team.
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        properties:
                          message:
                            type: string
                          type:
                            type: string
                          code:
                            type: integer
                          param:
                            type: string
                            nullable: true
                        type: object
                        required:
                          - message
                    type: object
                    required:
                      - error
                    title: StructuredError
                  - properties:
                      error:
                        type: string
                    type: object
                    required:
                      - error
                    title: SimpleError
                title: ErrorResponse
        '422':
          description: Deployment not found, or the request is unprocessable.
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        properties:
                          message:
                            type: string
                          type:
                            type: string
                          code:
                            type: integer
                          param:
                            type: string
                            nullable: true
                        type: object
                        required:
                          - message
                    type: object
                    required:
                      - error
                    title: StructuredError
                  - properties:
                      error:
                        type: string
                    type: object
                    required:
                      - error
                    title: SimpleError
                title: ErrorResponse
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        properties:
                          message:
                            type: string
                          type:
                            type: string
                          code:
                            type: integer
                          param:
                            type: string
                            nullable: true
                        type: object
                        required:
                          - message
                    type: object
                    required:
                      - error
                    title: StructuredError
                  - properties:
                      error:
                        type: string
                    type: object
                    required:
                      - error
                    title: SimpleError
                title: ErrorResponse
        '502':
          description: Backend disconnected before sending a response.
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        properties:
                          message:
                            type: string
                          type:
                            type: string
                          code:
                            type: integer
                          param:
                            type: string
                            nullable: true
                        type: object
                        required:
                          - message
                    type: object
                    required:
                      - error
                    title: StructuredError
                  - properties:
                      error:
                        type: string
                    type: object
                    required:
                      - error
                    title: SimpleError
                title: ErrorResponse
        '503':
          description: No healthy backend available for the requested model.
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        properties:
                          message:
                            type: string
                          type:
                            type: string
                          code:
                            type: integer
                          param:
                            type: string
                            nullable: true
                        type: object
                        required:
                          - message
                    type: object
                    required:
                      - error
                    title: StructuredError
                  - properties:
                      error:
                        type: string
                    type: object
                    required:
                      - error
                    title: SimpleError
                title: ErrorResponse
      security:
        - APIKeyHeader: []
components:
  schemas:
    ScoreRequest:
      anyOf:
        - $ref: '#/components/schemas/ScoreQueriesDocumentsRequest'
        - $ref: '#/components/schemas/ScoreQueriesItemsRequest'
        - $ref: '#/components/schemas/ScoreDataRequest'
        - $ref: '#/components/schemas/ScoreTextRequest'
    ScoreResponse:
      additionalProperties: true
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          title: Object
          default: list
        created:
          type: integer
          title: Created
        model:
          title: Model
          type: string
        data:
          items:
            $ref: '#/components/schemas/ScoreResponseData'
          title: Data
          type: array
        usage:
          $ref: '#/components/schemas/UsageInfo'
      required:
        - id
        - created
        - model
        - data
        - usage
      title: ScoreResponse
      type: object
    ScoreQueriesDocumentsRequest:
      additionalProperties: true
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Model
        user:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: User
        truncate_prompt_tokens:
          anyOf:
            - minimum: -1
              type: integer
            - type: 'null'
          default: null
          title: Truncate Prompt Tokens
        truncation_side:
          anyOf:
            - enum:
                - left
                - right
              type: string
            - type: 'null'
          default: null
          description: >-
            Which side to truncate from when truncate_prompt_tokens is active.
            'right' keeps the first N tokens. 'left' keeps the last N tokens.
          title: Truncation Side
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The request_id related to this request. If the caller does not set
            it, a random uuid will be generated.
          title: Request Id
        priority:
          default: 0
          description: >-
            The priority of the request (lower means earlier handling; default:
            0). Any priority other than 0 will raise an error if the served
            model does not use priority scheduling.
          title: Priority
          type: integer
        mm_processor_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: Additional kwargs to pass to the HF processor.
          title: Mm Processor Kwargs
        cache_salt:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            If specified, the prefix cache will be salted with the provided
            string to prevent an attacker from guessing prompts in multi-user
            environments.
          title: Cache Salt
        use_activation:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Whether to use activation for the pooler outputs. null uses the
            pooler's default, which is true in most cases.
          title: Use Activation
        max_tokens_per_query:
          default: 0
          description: >-
            Maximum number of tokens per query. Queries longer than this will be
            truncated. 0 means no query-level truncation is applied.
          title: Max Tokens Per Query
          type: integer
        max_tokens_per_doc:
          default: 0
          description: >-
            Maximum number of tokens per document. Documents longer than this
            will be truncated. 0 means no document-level truncation is applied
            (only truncate_prompt_tokens applies to the combined
            query+document).
          title: Max Tokens Per Doc
          type: integer
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Task instruction prepended to each scored pair via the chat
            template. Equivalent to passing chat_template_kwargs={'instruction':
            ...}.
          title: Instruction
        chat_template_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: >-
            Additional keyword args to pass to the chat template renderer. Will
            be accessible by the score/rerank chat template.
          title: Chat Template Kwargs
        queries:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Queries
        documents:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Documents
      required:
        - queries
        - documents
      title: ScoreQueriesDocumentsRequest
      type: object
    ScoreQueriesItemsRequest:
      additionalProperties: true
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Model
        user:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: User
        truncate_prompt_tokens:
          anyOf:
            - minimum: -1
              type: integer
            - type: 'null'
          default: null
          title: Truncate Prompt Tokens
        truncation_side:
          anyOf:
            - enum:
                - left
                - right
              type: string
            - type: 'null'
          default: null
          description: >-
            Which side to truncate from when truncate_prompt_tokens is active.
            'right' keeps the first N tokens. 'left' keeps the last N tokens.
          title: Truncation Side
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The request_id related to this request. If the caller does not set
            it, a random uuid will be generated.
          title: Request Id
        priority:
          default: 0
          description: >-
            The priority of the request (lower means earlier handling; default:
            0). Any priority other than 0 will raise an error if the served
            model does not use priority scheduling.
          title: Priority
          type: integer
        mm_processor_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: Additional kwargs to pass to the HF processor.
          title: Mm Processor Kwargs
        cache_salt:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            If specified, the prefix cache will be salted with the provided
            string to prevent an attacker from guessing prompts in multi-user
            environments.
          title: Cache Salt
        use_activation:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Whether to use activation for the pooler outputs. null uses the
            pooler's default, which is true in most cases.
          title: Use Activation
        max_tokens_per_query:
          default: 0
          description: >-
            Maximum number of tokens per query. Queries longer than this will be
            truncated. 0 means no query-level truncation is applied.
          title: Max Tokens Per Query
          type: integer
        max_tokens_per_doc:
          default: 0
          description: >-
            Maximum number of tokens per document. Documents longer than this
            will be truncated. 0 means no document-level truncation is applied
            (only truncate_prompt_tokens applies to the combined
            query+document).
          title: Max Tokens Per Doc
          type: integer
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Task instruction prepended to each scored pair via the chat
            template. Equivalent to passing chat_template_kwargs={'instruction':
            ...}.
          title: Instruction
        chat_template_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: >-
            Additional keyword args to pass to the chat template renderer. Will
            be accessible by the score/rerank chat template.
          title: Chat Template Kwargs
        queries:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Queries
        items:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Items
      required:
        - queries
        - items
      title: ScoreQueriesItemsRequest
      type: object
    ScoreDataRequest:
      additionalProperties: true
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Model
        user:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: User
        truncate_prompt_tokens:
          anyOf:
            - minimum: -1
              type: integer
            - type: 'null'
          default: null
          title: Truncate Prompt Tokens
        truncation_side:
          anyOf:
            - enum:
                - left
                - right
              type: string
            - type: 'null'
          default: null
          description: >-
            Which side to truncate from when truncate_prompt_tokens is active.
            'right' keeps the first N tokens. 'left' keeps the last N tokens.
          title: Truncation Side
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The request_id related to this request. If the caller does not set
            it, a random uuid will be generated.
          title: Request Id
        priority:
          default: 0
          description: >-
            The priority of the request (lower means earlier handling; default:
            0). Any priority other than 0 will raise an error if the served
            model does not use priority scheduling.
          title: Priority
          type: integer
        mm_processor_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: Additional kwargs to pass to the HF processor.
          title: Mm Processor Kwargs
        cache_salt:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            If specified, the prefix cache will be salted with the provided
            string to prevent an attacker from guessing prompts in multi-user
            environments.
          title: Cache Salt
        use_activation:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Whether to use activation for the pooler outputs. null uses the
            pooler's default, which is true in most cases.
          title: Use Activation
        max_tokens_per_query:
          default: 0
          description: >-
            Maximum number of tokens per query. Queries longer than this will be
            truncated. 0 means no query-level truncation is applied.
          title: Max Tokens Per Query
          type: integer
        max_tokens_per_doc:
          default: 0
          description: >-
            Maximum number of tokens per document. Documents longer than this
            will be truncated. 0 means no document-level truncation is applied
            (only truncate_prompt_tokens applies to the combined
            query+document).
          title: Max Tokens Per Doc
          type: integer
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Task instruction prepended to each scored pair via the chat
            template. Equivalent to passing chat_template_kwargs={'instruction':
            ...}.
          title: Instruction
        chat_template_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: >-
            Additional keyword args to pass to the chat template renderer. Will
            be accessible by the score/rerank chat template.
          title: Chat Template Kwargs
        data_1:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Data 1
        data_2:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Data 2
      required:
        - data_1
        - data_2
      title: ScoreDataRequest
      type: object
    ScoreTextRequest:
      additionalProperties: true
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Model
        user:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: User
        truncate_prompt_tokens:
          anyOf:
            - minimum: -1
              type: integer
            - type: 'null'
          default: null
          title: Truncate Prompt Tokens
        truncation_side:
          anyOf:
            - enum:
                - left
                - right
              type: string
            - type: 'null'
          default: null
          description: >-
            Which side to truncate from when truncate_prompt_tokens is active.
            'right' keeps the first N tokens. 'left' keeps the last N tokens.
          title: Truncation Side
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The request_id related to this request. If the caller does not set
            it, a random uuid will be generated.
          title: Request Id
        priority:
          default: 0
          description: >-
            The priority of the request (lower means earlier handling; default:
            0). Any priority other than 0 will raise an error if the served
            model does not use priority scheduling.
          title: Priority
          type: integer
        mm_processor_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: Additional kwargs to pass to the HF processor.
          title: Mm Processor Kwargs
        cache_salt:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            If specified, the prefix cache will be salted with the provided
            string to prevent an attacker from guessing prompts in multi-user
            environments.
          title: Cache Salt
        use_activation:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Whether to use activation for the pooler outputs. null uses the
            pooler's default, which is true in most cases.
          title: Use Activation
        max_tokens_per_query:
          default: 0
          description: >-
            Maximum number of tokens per query. Queries longer than this will be
            truncated. 0 means no query-level truncation is applied.
          title: Max Tokens Per Query
          type: integer
        max_tokens_per_doc:
          default: 0
          description: >-
            Maximum number of tokens per document. Documents longer than this
            will be truncated. 0 means no document-level truncation is applied
            (only truncate_prompt_tokens applies to the combined
            query+document).
          title: Max Tokens Per Doc
          type: integer
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Task instruction prepended to each scored pair via the chat
            template. Equivalent to passing chat_template_kwargs={'instruction':
            ...}.
          title: Instruction
        chat_template_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: >-
            Additional keyword args to pass to the chat template renderer. Will
            be accessible by the score/rerank chat template.
          title: Chat Template Kwargs
        text_1:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Text 1
        text_2:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ScoreMultiModalParam'
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/ScoreMultiModalParam'
              type: array
          title: Text 2
      required:
        - text_1
        - text_2
      title: ScoreTextRequest
      type: object
    ScoreResponseData:
      additionalProperties: true
      properties:
        index:
          type: integer
          title: Index
        object:
          default: score
          title: Object
          type: string
        score:
          title: Score
          type: number
      required:
        - index
        - score
      title: ScoreResponseData
      type: object
    UsageInfo:
      additionalProperties: true
      properties:
        prompt_tokens:
          default: 0
          title: Prompt Tokens
          type: integer
        total_tokens:
          default: 0
          title: Total Tokens
          type: integer
        completion_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          default: 0
          title: Completion Tokens
        prompt_tokens_details:
          anyOf:
            - $ref: '#/components/schemas/PromptTokenUsageInfo'
            - type: 'null'
          default: null
      title: UsageInfo
      type: object
    ScoreMultiModalParam:
      additionalProperties: true
      properties:
        content:
          items:
            anyOf:
              - $ref: '#/components/schemas/ContentPartText'
              - $ref: '#/components/schemas/ContentPartImage'
              - $ref: '#/components/schemas/ContentPartAudio'
              - $ref: '#/components/schemas/ContentPartVideo'
          title: Content
          type: array
      required:
        - content
      title: ScoreMultiModalParam
      type: object
    PromptTokenUsageInfo:
      additionalProperties: true
      properties:
        cached_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Cached Tokens
        created_cache_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Created Cache Tokens
        multimodal_tokens:
          anyOf:
            - additionalProperties:
                type: integer
              type: object
            - type: 'null'
          default: null
          description: >-
            Prompt tokens contributed by each input modality, keyed by modality
            name (e.g. `image`, `audio`, `video`). A breakdown of the multimodal
            placeholder tokens already counted in `prompt_tokens`; null when the
            request has no multimodal input.
          title: Multimodal Tokens
      title: PromptTokenUsageInfo
      type: object
    ContentPartText:
      additionalProperties: true
      properties:
        type:
          const: text
          default: text
          title: Type
          type: string
        text:
          title: Text
          type: string
      required:
        - text
      title: ContentPartText
      type: object
    ContentPartImage:
      additionalProperties: true
      properties:
        type:
          const: image_url
          default: image_url
          title: Type
          type: string
        image_url:
          $ref: '#/components/schemas/ImageURL'
      required:
        - image_url
      title: ContentPartImage
      type: object
    ContentPartAudio:
      additionalProperties: true
      properties:
        type:
          const: input_audio
          default: input_audio
          title: Type
          type: string
        input_audio:
          $ref: '#/components/schemas/InputAudio'
      required:
        - input_audio
      title: ContentPartAudio
      type: object
    ContentPartVideo:
      additionalProperties: true
      properties:
        type:
          const: video_url
          default: video_url
          title: Type
          type: string
        video_url:
          $ref: '#/components/schemas/VideoURL'
      required:
        - video_url
      title: ContentPartVideo
      type: object
    ImageURL:
      additionalProperties: true
      properties:
        url:
          description: Either an http(s) URL or a `data:image/...;base64,...` URI.
          title: Url
          type: string
        detail:
          anyOf:
            - enum:
                - auto
                - low
                - high
              type: string
            - type: 'null'
          default: auto
          title: Detail
      required:
        - url
      title: ImageURL
      type: object
    InputAudio:
      additionalProperties: true
      properties:
        data:
          description: Base64-encoded audio bytes.
          title: Data
          type: string
        format:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: e.g. `wav`, `mp3`.
          title: Format
      required:
        - data
      title: InputAudio
      type: object
    VideoURL:
      additionalProperties: true
      properties:
        url:
          title: Url
          type: string
      required:
        - url
      title: VideoURL
      type: object
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: >-
        Your Seekr API key, sent in the Authorization header with no 'Bearer'
        prefix.
      in: header
      name: Authorization

````

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