{
  "openapi": "3.0.1",
  "info": {
    "title": "HF Model License Drift Monitor",
    "description": "Monitor public Hugging Face model watchlists for license, gating, model-card, and governance-risk changes.",
    "version": "0.0",
    "x-build-id": "nNrgzaBRX6jzMkMJx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/defenestrator~hf-model-license-drift-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-defenestrator-hf-model-license-drift-monitor",
        "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/defenestrator~hf-model-license-drift-monitor/runs": {
      "post": {
        "operationId": "runs-sync-defenestrator-hf-model-license-drift-monitor",
        "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/defenestrator~hf-model-license-drift-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-defenestrator-hf-model-license-drift-monitor",
        "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": {
          "modelIds": {
            "title": "Hugging Face model IDs",
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "description": "Public Hugging Face model IDs to check, e.g. Qwen/Qwen2.5-7B-Instruct. This Actor is unofficial and only supports public model metadata; it does not download model weights.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 256,
              "pattern": "^(?:https://huggingface\\.co/)?(?:[A-Za-z0-9][A-Za-z0-9._-]{0,127}/)?[A-Za-z0-9][A-Za-z0-9._-]{0,127}(?:/(?:tree|blob|resolve|raw)/.+)?$"
            },
            "default": [
              "Qwen/Qwen2.5-7B-Instruct",
              "mistralai/Mistral-7B-Instruct-v0.3",
              "meta-llama/Llama-3.1-8B-Instruct",
              "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
            ]
          },
          "previousSnapshots": {
            "title": "Previous snapshot rows for drift detection",
            "maxItems": 200,
            "type": "array",
            "description": "Optional rows from a previous run of this Actor. When supplied, the Actor flags changes to license, gating, model-card hash/terms, risk level, repository SHA, and download counts.",
            "items": {
              "type": "object"
            },
            "default": []
          },
          "includeReadmeSignals": {
            "title": "Scan model card README risk terms",
            "type": "boolean",
            "description": "Fetch and scan the public README/model card for governance terms such as non-commercial, acceptable use, prohibited uses, attribution, and research-only. The README text itself is not stored, only a hash and matched terms.",
            "default": true
          },
          "maxReadmeChars": {
            "title": "Maximum README characters to scan",
            "minimum": 0,
            "maximum": 250000,
            "type": "integer",
            "description": "Safety cap for model card text scanning. Larger cards are truncated before risk-term scanning and hashing.",
            "default": 60000
          },
          "includeAllRows": {
            "title": "Include non-alert rows",
            "type": "boolean",
            "description": "When false, only alert rows are pushed to the dataset; the run summary still reports every checked model.",
            "default": true
          },
          "alertSeverityThreshold": {
            "title": "Alert severity threshold",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Rows at or above this score are marked alert=true. License/gating/risk drift can also force an alert.",
            "default": 45
          },
          "allowedLicenses": {
            "title": "Licenses treated as low-risk",
            "type": "array",
            "description": "SPDX-style license IDs treated as generally permissive for the Actor's coarse risk scoring. This is not legal advice.",
            "items": {
              "type": "string"
            },
            "default": [
              "apache-2.0",
              "mit",
              "bsd-2-clause",
              "bsd-3-clause",
              "isc",
              "cc0-1.0",
              "unlicense"
            ]
          },
          "reviewLicenses": {
            "title": "Licenses treated as review-needed",
            "type": "array",
            "description": "License IDs or substrings that should be reviewed before production/commercial use.",
            "items": {
              "type": "string"
            },
            "default": [
              "llama",
              "gemma",
              "openrail",
              "bigscience",
              "creativeml-openrail-m",
              "cc-by",
              "gpl",
              "agpl",
              "lgpl",
              "other"
            ]
          },
          "highRiskLicenseTerms": {
            "title": "License or card terms treated as high-risk",
            "type": "array",
            "description": "Case-insensitive substrings that raise license risk when found in license IDs or model-card text.",
            "items": {
              "type": "string"
            },
            "default": [
              "non-commercial",
              "noncommercial",
              "cc-by-nc",
              "no derivatives",
              "no-derivatives",
              "research only",
              "evaluation only",
              "not for commercial",
              "proprietary",
              "restricted use"
            ]
          },
          "minDownloadDeltaPercent": {
            "title": "Download change percentage alert",
            "minimum": 0,
            "maximum": 10000,
            "type": "number",
            "description": "When previousSnapshots include downloads, flag a notable adoption change at or above this absolute percentage.",
            "default": 25
          },
          "maxModels": {
            "title": "Maximum models per run",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Upper bound to keep scheduled runs cheap and predictable.",
            "default": 50
          },
          "timeoutMs": {
            "title": "Fetch timeout milliseconds",
            "minimum": 5000,
            "maximum": 60000,
            "type": "integer",
            "description": "Per-request timeout for Hugging Face public API and model-card fetches.",
            "default": 30000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}