openapi: 3.1.0
info:
  title: Silver Automobile Public API
  version: 1.0.0
  description: |
    Read-only public API for Silver Automobile, Bangalore's fastest auto parts
    supplier. Exposes a machine-readable catalog feed and an AI-powered part
    finder. No authentication required.
  contact:
    name: Silver Automobile
    email: info@silverautomobile.com
    url: https://silverautomobile.com
  license:
    name: Proprietary
servers:
  - url: https://silverautomobile.com
    description: Public site
  - url: https://mulhdqdwnklyyggaolfi.supabase.co
    description: AI endpoints
paths:
  /feed.json:
    get:
      operationId: listCatalogPages
      summary: List all public catalog and content pages
      description: Returns a JSON Feed 1.1 document listing every public page (brand pages, category pages, guides, legal).
      responses:
        "200":
          description: JSON Feed document
          content:
            application/feed+json:
              schema:
                type: object
                properties:
                  version: { type: string }
                  title: { type: string }
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id: { type: string }
                        url: { type: string, format: uri }
                        title: { type: string }
                        summary: { type: string }
                        tags:
                          type: array
                          items: { type: string }
  /llms.txt:
    get:
      operationId: getLlmsTxt
      summary: AI-readable site summary (llms.txt spec)
      responses:
        "200":
          description: Markdown document
          content:
            text/markdown:
              schema: { type: string }
  /sitemap.xml:
    get:
      operationId: getSitemap
      summary: XML sitemap of indexable pages
      responses:
        "200":
          description: XML sitemap
          content:
            application/xml:
              schema: { type: string }
  /functions/v1/ai-part-finder:
    post:
      operationId: findPart
      summary: AI-powered part finder
      description: |
        Ask a natural-language question about a car part. Returns a short
        recommendation and a link to the most relevant page on silverautomobile.com.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [query]
              properties:
                query:
                  type: string
                  description: Natural-language question
                  example: "brake pads for Swift Dzire 2019"
                make: { type: string, example: "Maruti Suzuki" }
                model: { type: string, example: "Swift Dzire" }
      responses:
        "200":
          description: AI recommendation
          content:
            application/json:
              schema:
                type: object
                properties:
                  answer: { type: string }
                  suggested_page: { type: string, format: uri }
        "400": { description: Invalid input }
        "429": { description: Rate limited }
