openapi: 3.1.0
info:
  title: GPT Plugins Directory API
  description: |
    Browse, search, and discover ChatGPT plugins. The original plugin
    directory from the ChatGPT plugin era (2023-2024), now maintained
    as an archive and research resource.
  version: 2.0.0
  contact:
    email: admin@projectlanterna.com

servers:
  - url: https://api.gptplugins.io/v1

paths:
  /plugins:
    get:
      operationId: listPlugins
      summary: List all plugins in the directory
      parameters:
        - name: category
          in: query
          schema:
            type: string
        - name: status
          in: query
          schema:
            type: string
            enum: [active, deprecated, expired]
        - name: page
          in: query
          schema:
            type: integer
        - name: limit
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: Plugin list

  /plugins/search:
    get:
      operationId: searchPlugins
      summary: Search plugins by name or description
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Search results

  /plugins/{plugin_id}:
    get:
      operationId: getPlugin
      summary: Get plugin details including manifest and OpenAPI spec
      parameters:
        - name: plugin_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Plugin details

  /plugins/{plugin_id}/manifest:
    get:
      operationId: getManifest
      summary: Get the ai-plugin.json manifest for a plugin
      parameters:
        - name: plugin_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Plugin manifest

  /categories:
    get:
      operationId: listCategories
      summary: List all plugin categories
      responses:
        '200':
          description: Category list

  /stats:
    get:
      operationId: getStats
      summary: Directory statistics
      responses:
        '200':
          description: Stats
