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

# Batch Execute Retriever

> Execute a retriever against multiple queries in a single request. The retriever is fetched and optimized once, then executed concurrently against each query with bounded parallelism.

**Use case:** IP safety / copyright clearance — scan 20 media files against face, logo, or audio retrievers in one call instead of 60 sequential SSE requests.

**Limits:** 1-50 queries per batch, 1-20 concurrency.

Returns results keyed by query index with per-query documents and errors.



## OpenAPI

````yaml post /v1/retrievers/{retriever_id}/execute/batch
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security: []
paths:
  /v1/retrievers/{retriever_id}/execute/batch:
    post:
      tags:
        - Retrievers
      summary: Batch Execute Retriever
      description: >-
        Execute a retriever against multiple queries in a single request. The
        retriever is fetched and optimized once, then executed concurrently
        against each query with bounded parallelism.


        **Use case:** IP safety / copyright clearance — scan 20 media files
        against face, logo, or audio retrievers in one call instead of 60
        sequential SSE requests.


        **Limits:** 1-50 queries per batch, 1-20 concurrency.


        Returns results keyed by query index with per-query documents and
        errors.
      operationId: execute_batch_v1_retrievers__retriever_id__execute_batch_post
      parameters:
        - name: retriever_id
          in: path
          required: true
          schema:
            type: string
            description: Retriever ID or name.
            title: Retriever Id
          description: Retriever ID or name.
        - name: return_presigned_urls
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Generate presigned URLs for S3-backed blobs and url-shaped fields.
              Also accepted as a body field — if either source is true,
              presigning is enabled.
            default: false
            title: Return Presigned Urls
          description: >-
            Generate presigned URLs for S3-backed blobs and url-shaped fields.
            Also accepted as a body field — if either source is true, presigning
            is enabled.
        - name: return_vectors
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Include vector embeddings in result documents. Also accepted as a
              body field — if either source is true, vectors are returned.
            default: false
            title: Return Vectors
          description: >-
            Include vector embeddings in result documents. Also accepted as a
            body field — if either source is true, vectors are returned.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteBatchRequest'
              description: Batch of queries to execute.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ExecuteBatchRequest:
      properties:
        queries:
          items:
            $ref: '#/components/schemas/BatchQueryItem'
          type: array
          maxItems: 50
          minItems: 1
          title: Queries
          description: >-
            List of queries to execute (1-50). Each gets the same retriever
            pipeline.
        settings:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Settings
          description: >-
            Shared settings applied to every query. Supports 'limit' (max
            results per query, default 10) and 'max_chunks' (for content-mode
            preprocessing).
        concurrency:
          type: integer
          maximum: 20
          minimum: 1
          title: Concurrency
          description: >-
            Max concurrent executions (1-20). Higher = faster but more resource
            usage.
          default: 5
        return_presigned_urls:
          type: boolean
          title: Return Presigned Urls
          description: >-
            Generate presigned URLs for S3-backed blobs and url-shaped fields.
            Also accepted as a query param — if either source is true,
            presigning is enabled.
          default: false
        return_vectors:
          type: boolean
          title: Return Vectors
          description: >-
            Include vector embeddings in result documents. Also accepted as a
            query param — if either source is true, vectors are returned.
          default: false
        stream:
          type: boolean
          title: Stream
          description: >-
            Stream results via Server-Sent Events. Each query result is emitted
            as it completes, with keepalive pings every 15s to prevent proxy
            timeouts.
          default: false
      type: object
      required:
        - queries
      title: ExecuteBatchRequest
      description: >-
        Request to execute a retriever against multiple queries in a single
        call.


        The retriever is fetched and optimized once, then executed concurrently

        against each query. Much more efficient than calling /execute N times

        when scanning multiple assets against the same retriever.


        Typical use case: IP safety / copyright clearance — check 20 media files

        against face, logo, or audio retrievers in one request.
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BatchQueryItem:
      properties:
        inputs:
          additionalProperties: true
          type: object
          title: Inputs
          description: >-
            Runtime inputs for this query (e.g., {'query':
            'https://example.com/img.jpg'})
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
          description: Optional per-query filters.
      type: object
      required:
        - inputs
      title: BatchQueryItem
      description: A single query within a batch execution request.
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````