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

# Find similar indexed images



## OpenAPI

````yaml /openapi.json post /v1/similar
openapi: 3.1.0
info:
  title: Lightdrift API
  version: '1.3'
  description: >-
    Natural-language image search for agents. Describe what you want — in text,
    with a reference image, or both — and get ranked images back, each with a
    machine-readable rights answer. Retrieval only: no generation, no checkout.
servers:
  - url: https://api.lightdrift.ai
    description: Production
security:
  - apiKey: []
paths:
  /v1/similar:
    post:
      summary: Find similar indexed images
      operationId: similar_v1_similar_post
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            default: ''
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimilarReq'
      responses:
        '200':
          description: Search results and source-declared rights.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
              example:
                query_id: q_db7b4305df746986bd859ae0
                results:
                  - asset_id: stocksnap:BAVURMUHRD
                    score: 0.74583352
                    title: car auto
                    source: stocksnap
                    ai_generated: false
                    width: 5000
                    height: 4000
                    file: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/stocksnap:BAVURMUHRD
                    thumb: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/stocksnap:BAVURMUHRD?v=thumb
                    rights:
                      license: cc0
                      license_verbatim: CC0 1.0
                      commercial: true
                      attribution_required: false
                      derivatives: true
                      share_alike: false
                      attribution: null
                      provenance_url: https://stocksnap.io/photo/car-auto-BAVURMUHRD
                      basis: as-declared by source; verify for critical use
                  - asset_id: stocksnap:77BA6D52D0
                    score: 0.7300238
                    title: red car
                    source: stocksnap
                    ai_generated: false
                    width: 5035
                    height: 3339
                    file: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/stocksnap:77BA6D52D0
                    thumb: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/stocksnap:77BA6D52D0?v=thumb
                    rights:
                      license: cc0
                      license_verbatim: CC0 1.0
                      commercial: true
                      attribution_required: false
                      derivatives: true
                      share_alike: false
                      attribution: null
                      provenance_url: https://stocksnap.io/photo/red-car-77BA6D52D0
                      basis: as-declared by source; verify for critical use
                  - asset_id: wm_quality:153180537
                    score: 0.71327692
                    title: 2024 Międzylesie, ul. Waryńskiego 11.jpg
                    source: wm_quality
                    ai_generated: false
                    width: 3222
                    height: 2838
                    file: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/wm_quality:153180537
                    thumb: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/wm_quality:153180537?v=thumb
                    rights:
                      license: cc-by-sa
                      license_verbatim: CC BY-SA 4.0
                      commercial: true
                      attribution_required: true
                      derivatives: true
                      share_alike: true
                      attribution: >-
                        "2024 Międzylesie, ul. Waryńskiego 11.jpg" by Jacek
                        Halicki, wm_quality, CC BY-SA
                      provenance_url: >-
                        https://commons.wikimedia.org/wiki/File:2024_Mi%C4%99dzylesie,_ul._Wary%C5%84skiego_11.jpg
                      basis: as-declared by source; verify for critical use
                  - asset_id: stocksnap:UOYLKV7K27
                    score: 0.69847137
                    title: car auto
                    source: stocksnap
                    ai_generated: false
                    width: 4898
                    height: 3265
                    file: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/stocksnap:UOYLKV7K27
                    thumb: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/stocksnap:UOYLKV7K27?v=thumb
                    rights:
                      license: cc0
                      license_verbatim: CC0 1.0
                      commercial: true
                      attribution_required: false
                      derivatives: true
                      share_alike: false
                      attribution: null
                      provenance_url: https://stocksnap.io/photo/car-auto-UOYLKV7K27
                      basis: as-declared by source; verify for critical use
                  - asset_id: wm_quality:75913777
                    score: 0.69786596
                    title: 2001 Rover Mini Cooper Sport 1.3 Rear.jpg
                    source: wm_quality
                    ai_generated: false
                    width: 3840
                    height: 2479
                    file: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/wm_quality:75913777
                    thumb: >-
                      https://api.lightdrift.ai/v1/asset/q_db7b4305df746986bd859ae0/wm_quality:75913777?v=thumb
                    rights:
                      license: cc-by-sa
                      license_verbatim: CC BY-SA 4.0
                      commercial: true
                      attribution_required: true
                      derivatives: true
                      share_alike: true
                      attribution: >-
                        "2001 Rover Mini Cooper Sport 1.3 Rear.jpg" by Vauxford,
                        wm_quality, CC BY-SA
                      provenance_url: >-
                        https://commons.wikimedia.org/wiki/File:2001_Rover_Mini_Cooper_Sport_1.3_Rear.jpg
                      basis: as-declared by source; verify for critical use
                latency_ms: 72
                timing_ms:
                  retrieve: 72
                ranking: none
                mode: none
                pool_size: 99
                reranked: 0
                backend: voyage
          headers:
            X-RateLimit-Limit:
              schema:
                type: string
              description: e.g. `60/min, 5000/day`
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests left in the tighter window
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the minute window resets
            X-RateLimit-Tier:
              schema:
                type: string
                enum:
                  - promo
                  - starter
                  - growth
                  - scale
                  - enterprise
            X-Concurrency-Limit:
              schema:
                type: integer
              description: Searches allowed in flight at once
        '402':
          description: Insufficient prepaid credit.
          content:
            application/json:
              example:
                detail: insufficient credit
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit or concurrency limit exceeded; `Retry-After` in seconds.
          headers:
            Retry-After:
              schema:
                type: integer
            X-RateLimit-Limit:
              schema:
                type: string
              description: e.g. `60/min, 5000/day`
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests left in the tighter window
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the minute window resets
            X-RateLimit-Tier:
              schema:
                type: string
                enum:
                  - promo
                  - starter
                  - growth
                  - scale
                  - enterprise
            X-Concurrency-Limit:
              schema:
                type: integer
              description: Searches allowed in flight at once
          content:
            application/json:
              examples:
                rate:
                  value:
                    detail: 'rate limit exceeded: 30 per minute on the promo tier'
                concurrency:
                  value:
                    detail: too many concurrent requests for this account (max 2)
        '503':
          description: >-
            Search/provider/auth dependency unavailable. Honor Retry-After;
            failed search is not charged.
components:
  schemas:
    SimilarReq:
      properties:
        asset_id:
          type: string
          title: Asset Id
        k:
          type: integer
          maximum: 100
          minimum: 1
          title: K
          default: 10
        ann_k:
          type: integer
          maximum: 1000
          minimum: 1
          title: Ann K
          default: 100
        ann_ef:
          type: integer
          maximum: 4096
          minimum: 64
          title: Ann Ef
          default: 2048
        explain:
          type: boolean
          title: Explain
          default: false
        filters:
          $ref: '#/components/schemas/Filters'
        client_session:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Session
      type: object
      required:
        - asset_id
      title: SimilarReq
    SearchResponse:
      type: object
      properties:
        query_id:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/Result'
        latency_ms:
          type: integer
        timing_ms:
          type: object
          properties:
            embed:
              type: integer
            retrieve:
              type: integer
            rerank:
              type: integer
        mode:
          type: string
        ranking:
          type: string
          description: >-
            text, image, multimodal, none, or none (degraded). Multimodal scores
            fuse similarity and text ranks; scores are not probabilities.
        pool_size:
          type: integer
        reranked:
          type: integer
        backend:
          type: string
          description: Search responses report voyage.
        degraded:
          type: string
          description: >-
            Reranker unavailable; results are in retrieval order. Successful
            billed response.
        relaxed:
          type: array
          items:
            type: string
          description: >-
            Default filters relaxed to fill results; explicit constraints are
            not relaxed.
        query_type:
          type: string
          enum:
            - text
            - image
            - image_text
          description: Input modality for /v1/search.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Filters:
      properties:
        commercial:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Commercial
        attribution_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Attribution Required
        derivatives:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Derivatives
        license_id:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: License Id
        source:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Source
        min_width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Width
        min_height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Height
        orientation:
          anyOf:
            - type: string
            - type: 'null'
          title: Orientation
        colors:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Colors
        monochrome:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Monochrome
        year_min:
          anyOf:
            - type: integer
            - type: 'null'
          title: Year Min
        year_max:
          anyOf:
            - type: integer
            - type: 'null'
          title: Year Max
        ai_generated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ai Generated
        nsfw_max:
          anyOf:
            - type: number
            - type: 'null'
          title: Nsfw Max
          default: 0.2
        format:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Format
      type: object
      title: Filters
    Result:
      type: object
      properties:
        asset_id:
          type: string
        score:
          type:
            - number
            - 'null'
        title:
          type: string
        source:
          type: string
        ai_generated:
          type: boolean
        width:
          type: integer
        height:
          type: integer
        file:
          type: string
        thumb:
          type: string
        rights:
          $ref: '#/components/schemas/Rights'
    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
    Rights:
      type: object
      properties:
        license:
          type: string
        license_verbatim:
          type: string
        commercial:
          type: boolean
        attribution_required:
          type: boolean
        derivatives:
          type: boolean
        share_alike:
          type: boolean
        attribution:
          type:
            - string
            - 'null'
        provenance_url:
          type: string
        basis:
          type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Lightdrift API key. Usage is metered per query.

````