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

# Predictive Search

> Fuzzy autocomplete on product name. Returns ≤6 hits matched by
trigram similarity (`similarity(name, q) ≥ 0.2`) OR leading
prefix (`name ILIKE q || '%'`). Tenant-scoped.



## OpenAPI

````yaml /api-reference/openapi.json get /api/storefront/search/predictive
openapi: 3.1.0
info:
  title: Agentic Commerce API
  description: |2-

        Agentic Commerce API - E-commerce Backend

        ## APIs

        ### Dashboard API (`/api/dashboard`)
        Authenticated endpoints for merchant management:
        - Products, Variants, Options
        - Inventory management
        - Orders and fulfillment
        - Customers
        - Collections

        ### Storefront API (`/api/storefront`)
        Public endpoints for client websites:
        - Product catalog
        - Collections
        - Cart management
        - Checkout

        ### Sync API (`/api/sync`)
        Integration endpoints for zunkiree-search:
        - Product sync
        - Availability checks
        - Order creation from AI widget
        
  version: 1.0.0
servers: []
security: []
paths:
  /api/storefront/search/predictive:
    get:
      tags:
        - Storefront
        - Storefront Search
      summary: Predictive Search
      description: |-
        Fuzzy autocomplete on product name. Returns ≤6 hits matched by
        trigram similarity (`similarity(name, q) ≥ 0.2`) OR leading
        prefix (`name ILIKE q || '%'`). Tenant-scoped.
      operationId: predictive_search_api_storefront_search_predictive_get
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            title: Q
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 6
            minimum: 1
            default: 6
            title: Limit
        - name: X-Site-ID
          in: header
          required: true
          schema:
            type: string
            title: X-Site-Id
        - name: X-Stella-Token
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Stella-Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontPredictiveResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StorefrontPredictiveResponse:
      properties:
        query:
          type: string
          title: Query
        hits:
          items:
            $ref: '#/components/schemas/StorefrontPredictiveHit'
          type: array
          title: Hits
      type: object
      required:
        - query
        - hits
      title: StorefrontPredictiveResponse
      description: ≤6 hits, ranked by trigram + prefix match.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StorefrontPredictiveHit:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Slug
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
      type: object
      required:
        - id
        - name
        - slug
        - image_url
      title: StorefrontPredictiveHit
      description: Compact autocomplete result — just enough to render the dropdown.
    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

````