{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cliponit-app/json-schema/cliponit-app-clip-schema.json",
  "title": "Clip",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cliponit-app-smart-api-openapi.yml#/components/schemas/Clip",
  "allOf": [
    {
      "$ref": "#/$defs/ClipBase"
    },
    {
      "type": "object",
      "properties": {
        "score": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "maximum": 100,
          "description": "Estimated viral potential (AI)"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "description": "One sentence explaining the score, in the transcript language"
        },
        "score_detail": {
          "type": [
            "object",
            "null"
          ],
          "description": "Sub-scores (0-10) the score is computed from: hook, standalone, payoff, emotion, value, shareability (weights 0.25/0.20/0.20/0.15/0.10/0.10). Null for older clips and search results",
          "additionalProperties": {
            "type": "integer"
          }
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Ready-to-post caption (null until `describeClip`)"
        },
        "hashtags": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "Without `#`"
        },
        "thumbnail_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "`/files/thumbs/clips/<clip_id>.jpg`, 320 px frame at start_s + 1"
        }
      }
    }
  ],
  "$defs": {
    "ClipBase": {
      "type": "object",
      "required": [
        "id",
        "video_id",
        "position",
        "title",
        "start_s",
        "end_s",
        "created_at"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/Uuid"
        },
        "video_id": {
          "$ref": "#/$defs/Uuid"
        },
        "position": {
          "type": "integer",
          "description": "Chronological order"
        },
        "title": {
          "type": "string"
        },
        "start_s": {
          "type": "number",
          "description": "Absolute start in the source video (seconds)"
        },
        "end_s": {
          "type": "number",
          "description": "Absolute end (seconds)"
        },
        "created_at": {
          "type": "string"
        }
      }
    },
    "Uuid": {
      "type": "string",
      "format": "uuid"
    }
  }
}