{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Hub Change Events",
    "description": "Monitor Hugging Face models and datasets for structured license, access, revision, metadata, and adoption-trend change events.",
    "version": "0.1",
    "x-build-id": "PjtvBe6nejGWZmLwG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/immense_insulator~ai-hub-change-events/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-immense_insulator-ai-hub-change-events",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/immense_insulator~ai-hub-change-events/runs": {
      "post": {
        "operationId": "runs-sync-immense_insulator-ai-hub-change-events",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/immense_insulator~ai-hub-change-events/run-sync": {
      "post": {
        "operationId": "run-sync-immense_insulator-ai-hub-change-events",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "resources": {
            "title": "Model and dataset watchlist",
            "type": "array",
            "description": "Exact public Hub repositories to monitor.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "title": "Resource type",
                  "description": "Choose a Hugging Face model or dataset repository.",
                  "type": "string",
                  "enum": [
                    "model",
                    "dataset"
                  ]
                },
                "id": {
                  "title": "Repository ID",
                  "description": "Exact repository ID, for example Qwen/Qwen2.5-0.5B-Instruct.",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "id"
              ]
            },
            "default": [
              {
                "type": "model",
                "id": "Qwen/Qwen2.5-0.5B-Instruct"
              }
            ]
          },
          "discoveryQueries": {
            "title": "Discovery queries",
            "type": "array",
            "description": "Optional rolling searches. New matching repositories become REPOSITORY_DISCOVERED events after the baseline run.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "title": "Resource type",
                  "description": "Search models or datasets.",
                  "type": "string",
                  "enum": [
                    "model",
                    "dataset"
                  ]
                },
                "search": {
                  "title": "Search text",
                  "description": "Optional Hugging Face Hub search text.",
                  "type": "string"
                },
                "author": {
                  "title": "Author",
                  "description": "Optional exact author or organization filter.",
                  "type": "string"
                },
                "filter": {
                  "title": "Hub filter",
                  "description": "Optional Hugging Face task, library, or tag filter.",
                  "type": "string"
                },
                "sort": {
                  "title": "Sort order",
                  "description": "Choose how discovery results are ordered.",
                  "type": "string",
                  "enum": [
                    "lastModified",
                    "downloads",
                    "likes",
                    "trendingScore"
                  ]
                },
                "limit": {
                  "title": "Result limit",
                  "description": "Maximum repositories discovered by this query.",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                }
              },
              "required": [
                "type"
              ]
            },
            "default": []
          },
          "bootstrapMode": {
            "title": "First-run behavior",
            "enum": [
              "snapshot",
              "emit-discovered"
            ],
            "type": "string",
            "description": "Choose whether the first run silently stores a baseline or emits discovery events.",
            "default": "snapshot"
          },
          "eventTypes": {
            "title": "Event type filter",
            "uniqueItems": true,
            "type": "array",
            "description": "Empty means all event types.",
            "items": {
              "type": "string",
              "enum": [
                "REPOSITORY_DISCOVERED",
                "LICENSE_CHANGED",
                "ACCESS_CHANGED",
                "REVISION_CHANGED",
                "METADATA_CHANGED",
                "DOWNLOAD_TREND",
                "LIKE_TREND"
              ]
            },
            "default": []
          },
          "minDownloadDelta": {
            "title": "Minimum download delta",
            "minimum": 0,
            "type": "integer",
            "description": "Emit a download trend event only when the absolute download increase reaches this threshold.",
            "default": 1000
          },
          "minDownloadGrowthPercent": {
            "title": "Minimum download growth (%)",
            "minimum": 0,
            "type": "number",
            "description": "Emit a download trend event only when percentage growth reaches this threshold.",
            "default": 10
          },
          "minLikeDelta": {
            "title": "Minimum like delta",
            "minimum": 0,
            "type": "integer",
            "description": "Emit a like trend event only when the like increase reaches this threshold.",
            "default": 10
          },
          "maxItems": {
            "title": "Maximum resources per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of model and dataset repositories checked in one run.",
            "default": 100
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Use a distinct key for each independent monitor.",
            "default": "AI_HUB_CHANGE_STATE"
          },
          "huggingFaceToken": {
            "title": "Optional Hugging Face token",
            "type": "string",
            "description": "Optional for higher API limits. Stored as a secret input."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}