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

# Rank Ad Library Feed Semantically

> Meaning-rank only the ads in a fixed client feed.

Top Ads, Analyzed Ads, and Swipe File are finite collections assembled by
the dashboard. Their semantic search must never substitute unrelated global
library cards, so the caller supplies the exact allowed ad ids.



## OpenAPI

````yaml /openapi.json post /api/v1/ad-library/semantic-rank
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/ad-library/semantic-rank:
    post:
      tags:
        - Ad Library
        - Ad Library
      summary: Rank Ad Library Feed Semantically
      description: >-
        Meaning-rank only the ads in a fixed client feed.


        Top Ads, Analyzed Ads, and Swipe File are finite collections assembled
        by

        the dashboard. Their semantic search must never substitute unrelated
        global

        library cards, so the caller supplies the exact allowed ad ids.
      operationId: rank_ad_library_feed_semantically_api_v1_ad_library_semantic_rank_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdLibrarySemanticRankRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdLibrarySemanticRankResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AdLibrarySemanticRankRequest:
      properties:
        query:
          type: string
          maxLength: 400
          minLength: 1
          title: Query
        ad_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 2000
          minItems: 1
          title: Ad Ids
        limit:
          type: integer
          maximum: 100
          minimum: 1
          title: Limit
          default: 100
      type: object
      required:
        - query
        - ad_ids
      title: AdLibrarySemanticRankRequest
      description: Meaning-rank a caller-owned ad feed without leaking global results.
    AdLibrarySemanticRankResponse:
      properties:
        query:
          type: string
          title: Query
        ad_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Ad Ids
        returned:
          type: integer
          title: Returned
      type: object
      required:
        - query
        - ad_ids
        - returned
      title: AdLibrarySemanticRankResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````