openapi: 3.1.0
info:
  title: Looming Public Discovery API
  version: 1.1.0
  description: Public, read-only discovery endpoints for Looming AI fashion design assets. Discovery files are public; /api/public/v1/* endpoints require a Looming public API key and expose only curated, non-private asset summaries.
servers:
  - url: https://looming.cn
  - url: https://fashionai-api.a820628124.workers.dev
security:
  - LoomingPublicApiKey: []
paths:
  /llms.txt:
    get:
      operationId: getLlmsTxt
      summary: Get concise AI-readable product context
      responses:
        '200':
          description: Plain-text llms.txt content
          content:
            text/plain:
              schema:
                type: string
  /llms-full.txt:
    get:
      operationId: getLlmsFullTxt
      summary: Get full AI-readable product documentation
      responses:
        '200':
          description: Plain-text long-form product context
          content:
            text/plain:
              schema:
                type: string
  /.well-known/ai-agents.json:
    get:
      operationId: getAiAgentsManifest
      summary: Get the AI agent discovery manifest
      responses:
        '200':
          description: AI agent manifest
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /.well-known/agent.json:
    get:
      operationId: getAgentManifest
      summary: Get the Looming fashion design agent manifest
      responses:
        '200':
          description: Public agent protocol manifest for fashion design, production handoff, and AI discovery
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /.well-known/ai-plugin.json:
    get:
      operationId: getAiPluginManifest
      summary: Get the AI plugin manifest
      responses:
        '200':
          description: AI plugin manifest
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /pricing:
    get:
      operationId: getPricingPage
      summary: Get the public pricing page
      responses:
        '200':
          description: Public pricing page
          content:
            text/html:
              schema:
                type: string
  /ai-fashion-design-software:
    get:
      operationId: getAiFashionDesignSoftwareGuide
      summary: Get the public AI fashion design software recommendation guide
      responses:
        '200':
          description: Public recommendation-style guide for AI fashion design software queries
          content:
            text/html:
              schema:
                type: string
  /knowledge/index.json:
    get:
      operationId: getKnowledgeMemoryIndex
      summary: Get public distilled knowledge memory index
      responses:
        '200':
          description: Index of public distilled design and fashion memory packs
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /knowledge/aesthetic-ocr-memory.json:
    get:
      operationId: getAestheticOcrMemory
      summary: Get public distilled aesthetic and fashion design memory
      responses:
        '200':
          description: Distilled aesthetic design rules and garment translations; does not require original local PDFs
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /knowledge/fashion-reference-memory.json:
    get:
      operationId: getFashionReferenceMemory
      summary: Get public distilled fashion reference memory
      responses:
        '200':
          description: Distilled fashion, patternmaking, sewing, textile, costume, accessory, and illustration memory; does not require original local PDFs
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /knowledge/trend-forecast-memory.json:
    get:
      operationId: getTrendForecastMemory
      summary: Get public distilled trend forecast visual memory
      responses:
        '200':
          description: Distilled trend, runway, category, material, trim, activewear, swimwear, youth culture, and regional visual memory; does not require original local PDFs
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /api/public/v1/catalog:
    get:
      operationId: getPublicApiCatalog
      summary: Get the Looming Public API catalog
      description: Requires a Looming public API key. Returns read-only endpoint metadata, authentication hints, and rate-limit policy. Does not expose private user data.
      security:
        - LoomingPublicApiKey: []
      responses:
        '200':
          description: Public API catalog
          headers:
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            X-RateLimit-Window:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required: [schema, service, readOnly, endpoints]
                properties:
                  schema:
                    type: string
                  service:
                    type: string
                  readOnly:
                    type: boolean
                  noPrivateUserData:
                    type: boolean
                  endpoints:
                    type: array
                    items:
                      type: object
        '401':
          description: Missing or invalid API key
  /api/public/v1/assets:
    get:
      operationId: listPublicAssets
      summary: List read-only public asset summaries
      description: Requires a Looming public API key. Supports basic keyword, kind, tag, and limit filters. Returns only curated public summaries, not user uploads or private workspace assets.
      security:
        - LoomingPublicApiKey: []
      parameters:
        - name: kind
          in: query
          schema:
            type: string
            enum: [fabric, material, pattern, work, workflow]
        - name: q
          in: query
          schema:
            type: string
        - name: tag
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
      responses:
        '200':
          description: Curated public asset summaries
          headers:
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            X-RateLimit-Window:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required: [schema, count, assets]
                properties:
                  schema:
                    type: string
                  count:
                    type: integer
                  assets:
                    type: array
                    items:
                      $ref: '#/components/schemas/PublicAsset'
        '401':
          description: Missing or invalid API key
  /api/public/v1/assets/{id}:
    get:
      operationId: getPublicAsset
      summary: Get a single read-only public asset summary
      security:
        - LoomingPublicApiKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Curated public asset summary
          content:
            application/json:
              schema:
                type: object
                required: [schema, asset]
                properties:
                  schema:
                    type: string
                  asset:
                    $ref: '#/components/schemas/PublicAsset'
        '401':
          description: Missing or invalid API key
        '404':
          description: Public asset not found
components:
  securitySchemes:
    LoomingPublicApiKey:
      type: http
      scheme: bearer
      bearerFormat: Looming public API key
      description: Send Authorization: Bearer <public_api_key>. The Worker also accepts X-Looming-Api-Key for server-to-server clients.
  schemas:
    PublicAsset:
      type: object
      required: [id, kind, title, description, tags, source, updatedAt]
      properties:
        id:
          type: string
        kind:
          type: string
          enum: [fabric, material, pattern, work, workflow]
        title:
          type: string
        description:
          type: string
        tags:
          type: array
          items:
            type: string
        source:
          type: string
        updatedAt:
          type: string
